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

Viewed 1734

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

1 Answers

Upgrade chromedriver to 2.33.

On Mac you can upgrade it via brew brew upgrade chromedriver

Related