Reputation: 337
I am using selenium to automate ui testing with google chrome. As part of my testing, I resize windows several times during the suite.
I am using RobotFramework's Selenium2Library to get the job done with the following two keywords:
Set Window Size | 1080 | 800
Maximize Browser Window
Which are essentially just thin wrappers around the python selenium functions of the same name. Some time in the last few days, all the tests that involve window resizing began failing, and I think the culprit is the newest version of chrome.
The error:
WebDriverException: Message: unknown error: cannot get automation
extension from unknown error: page could not be found:
chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
When I tried altering the screen size with:
driver.execute_script("window.resizeTo({},{})".format(width, height))
I get no response at all (no error or change to window size)
Does anyone have a workaround for this? It is important that we keep the suite in chrome, and I need to resize during the test if at all possible.
Thanks,
Joe
Upvotes: 1
Views: 2338
Reputation: 1201
Which version of chromedriver do you use? This problem happened to me before I upgraded to version 2.28 along with update of Chrome to v57 (previously I used 2.26 and the error with the very same message as yours appeared).
Upvotes: 1