Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting a Ruby "KeyError: key not found: 102" error when trying to maximize browser window using Selenium Webdriver v3.70

I've recently upgraded my Selenium Webdriver version to 3.70 and when I try to maximize the browser window, I get this error:

KeyError: key not found: 102

Maximizing the window beforehand (on the previous version) seemed to be working absolutely fine, I'm not sure if it's just a coincidence though as it isn't a standard type of Selenium error.

Here's my code:

  profile = Selenium::WebDriver::Chrome::Profile.new
  $driver = Selenium::WebDriver.for :chrome, :profile => profile
  $driver.manage.window.maximize

Anyone else having this problem? Also worth noting I'm using Ruby v2.3.1, so perhaps that needs updating? I just didn't want to make loads of drastic updates, but wanted the latest Selenium Webdriver version. I also don't know whether it's chromedriver related, but last updated this to the latest version on 19/09/17.

Thanks in advance, Dan

like image 563
dan.brown Avatar asked Nov 10 '17 12:11

dan.brown


1 Answers

Upgrade chromedriver to 2.33.

On Mac you can upgrade it via brew brew upgrade chromedriver

like image 75
An Duong Avatar answered Nov 16 '22 03:11

An Duong