mardi 7 juillet 2020

Changing window size with Selenium used with a Chromium based browser

I am using Selenium 2.35.0 to test a Chromium based browser. I am using Chrome driver version 2.43.600233 and set my application name to Chrome and version to 2.43.600233 as recommended in
https://ift.tt/2O2Wkgr

"I had the same problem, and a way to hack it is to set your QT applicationName and applicationVersion to "Chrome" and "69.0.3497.128". "

Everything then worked fine. I only ran to an issue when I tried maximizing,minimizing, changing window size of my window using

driver.manage().window().maximize(); 
driver.manage().window().setSize(d);

I ran to this error

{"code":-32601,"message":"'Browser.getWindowForTarget' wasn't found"}.

When I searched for that error,I found this question

Сhromedriver: how to add support of Chromium-based browsers

The answers mentions

I warn you in advance that you should not use the window_size parameter, since Chromium does not support it, otherwise we will encounter an error: [Facebook\WebDriver\Exception\UnknownServerException] unknown error: unhandled inspector error: {"code":-32601,"message":"'Browser.getWindowForTarget' wasn't found"}.

Is there any hack to get over that. I need to test my browser when I do any window resizing.

Thanks a lot in advance.

Aucun commentaire:

Enregistrer un commentaire