setWindowRect method took to long

Hi guys, I have an issue with running auto tests on website opened in Android Chrome.

Appium Version: 1.18.0
Electron: 7.2.4
Node.js: 12.8.1

I will paste the log here:

[W3C (55c80329)] Driver proxy active, passing request on via HTTP proxy

[WD Proxy] Matched ‘/wd/hub/session/55c80329-5e79-4f23-a0e2-5cb1a3f659ad/window/rect’ to command name ‘setWindowRect’

[WD Proxy] Proxying [POST /wd/hub/session/55c80329-5e79-4f23-a0e2-5cb1a3f659ad/window/rect] to [POST http://127.0.0.1:8201/wd/hub/session/9b678f7f-9657-45d1-8b4a-7ac96c55c146/window/rect] with body: {“width”:1366,“height”:768}
[WD Proxy] Got response with status 404:
[W3C (55c80329)] Encountered internal error running command: Error: Could not proxy. Proxy error: Request failed with status code 404
[W3C (55c80329)] at doJwpProxy (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:494:13)
[W3C (55c80329)] at asyncHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:253:9)
[HTTP] <-- POST /wd/hub/session/55c80329-5e79-4f23-a0e2-5cb1a3f659ad/window/rect 500 60027 ms - 693

This command tried to be executed right after start auto test (and waits about 60 secs every time), and before opening website url. After returning error 404, the URL is successfully opened and the tests runs without any issues.
This 60secs costs too much.

Any help?
Thanks in advance!

If this is UiAutomator2 then it was fixed in v. 1.18.1

Also, check why your client is sending the setWindowRect command - it makes no sense in mobile context

1 Like

Thanks for your answer!
Resolved.
I had a predefined method in my code that sets a specific screen size and I use it for non-mobile tests, it’s usually a problem, I deleted the line and now it’s doing everything right.