Inconsistent error when validating my script

Hello! I’ve been working on a monitor for a website an about half of my validation attempts i get this error (Error: unknown error: failed to change window state to normal, current state is maximized). To get the monitor to work I used this code I found ($browser.manage().window().setSize(2880, 1800) but ever since then I get the window size error. The issue its not consistent and to fix it I just validate the script again. I also get this error INTERNAL ENGINE ERROR ([1899395/c624c156-c53a-4da7-b98c-eb0fe6471169/23dde2cb-a0e2-4cb3-84d8-8165dd8fce85] - code: 22) which I am not sure if they are linked or not.

Any help is appreciated !!


Hi, @cmeans: Unfortunately, current versions of Chrome no longer allow JavaScript to change the size of the main browser window. The workaround is to use $browser.executeScript() to open your target page in a popup window of the desired size, then switch to that window to execute the remainder of your script. Example here:

Thanks for the help!!

Do you happen to know why the other error shows up from time to time? INTERNAL ENGINE ERROR ([1899395/c624c156-c53a-4da7-b98c-eb0fe6471169/23dde2cb-a0e2-4cb3-84d8-8165dd8fce85] - code: 22)

No, unfortunately I am not familiar with that error.

Unfortunately the code generated by the SEformatter for New Relic (latest version) generates the same error. It’s not depending on the runtime, we have this with the old and new runtime and about 25% of script executions fail with this error. That generates quite a lot of false positives!

As the code example above is not too clear, I would request a proper formatted code snippet and even better, a change to the SEFormatter to generate this from a start.

Hi, @wkiNewRelic: When you request a “proper formatted code snippet”, are you referring to the code in this post?

How would you like to see it formatted differently?

Also, when you mention SEformatter, are you referring to this tool?

If so, you might contact the author directly; the above tool is not supported by New Relic.

Finally, have you tried Katalon recorder? Does it produce the same errors?

It’s my fault, I overlooked that the formatting gets right if I completely open the code snippet.

Yes, that’s the tool. We also tried the Katalon recorder. It does not have this problem as it does not generate resize command in the first place. But Katalon creates less maintainable code, so our users switched back to Selenium once the latest formatter was available.

Thanks for the information about the author of the SEformatter.

1 Like

I’m not sure it would be most helpful. But an option could be to try out the Selenium IDE with exporter as detailed here:

Can someone confirm which version of private minion was this chrome version introduced?

I would than run the version before privately to keep my scripts running. They are complicated to adapt to solution mentioned earlier.