Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide fallbacks for getWindowRect and setWindowRect #26

Open
jonhoo opened this issue May 13, 2018 · 8 comments
Open

Provide fallbacks for getWindowRect and setWindowRect #26

jonhoo opened this issue May 13, 2018 · 8 comments

Comments

@jonhoo
Copy link
Owner

jonhoo commented May 13, 2018

These should fall back to individual calls to (get/set)WindowSize + (get/set)WindowPosition if the Rect commands return "unknown command". See the commit that introduces rect to the selenium JS bindings: SeleniumHQ/selenium@6103ef6

/cc @phrohdoh

@jonhoo
Copy link
Owner Author

jonhoo commented May 13, 2018

See also d2843b0

@phrohdoh
Copy link
Contributor

AFAICT there are no such commands as the spec only lists SetWindowRect and GetWindowRect.

@jonhoo
Copy link
Owner Author

jonhoo commented May 14, 2018

Yeah, the spec only has those, but to be helpful there are a couple of places where we fall back to the original Selenium protocol (this is what the legacy field is for).

@phrohdoh
Copy link
Contributor

Oh I see, I did not understand previously. Sounds easy enough.

@jonhoo
Copy link
Owner Author

jonhoo commented May 14, 2018

It looks like there are also some test failures in Chrome on macOS: https://travis-ci.org/jonhoo/fantoccini/jobs/378871411#L873. My guess is that it's related to the window decorations causing an offset in the returned values (see https://github.com/SeleniumHQ/selenium/blob/6103ef6c923ea43c71779be9a05cc3a6248d1b53/javascript/node/selenium-webdriver/test/window_test.js#L125)

@jonhoo jonhoo assigned jonhoo and unassigned jonhoo May 17, 2018
@jonhoo
Copy link
Owner Author

jonhoo commented May 21, 2018

Sadly these tests also fail when running on a machine with a tiling window manager :(

@stevepryde
Copy link
Contributor

@jonhoo I'm running into this with thirtyfour now. I notice the relevant tests are marked as ignored for now. It seems chromedriver returns only the width and height in this situation, which to my reading goes against the spec. Is this actually a bug in chromedriver on MacOS? I'm happy to raise an issue there given that it's quite easy to reproduce.

I'll probably mask the test failure in thirtyfour for now.

@jonhoo
Copy link
Owner Author

jonhoo commented Jul 26, 2022

Could very well be — I've lost the context on this in the intervening years 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants