-
Notifications
You must be signed in to change notification settings - Fork 8
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
Make WebDriver DPI scaling-aware. #37
Conversation
And expose current DPI scaling factor in status bar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I have a question whether this is needed for the web API.
Yep, even though it's a web API it interacts with the screen. And every process that interacts with the screen on Windows is subject to translation of screen coordinates if it's not per-monitor DPI aware. A couple of examples:
I've found some relevant Microsoft documentation for this: Scaling in UI Automation Clients The advice there is:
The client application in this case being the WebDriver. This PR doesn't call Footnotes
|
This PR makes the WebDriver process DPI scaling aware. If this is not done then capturing screenshots will not work on monitors with scaling other than 100% and sometimes element positioning is miscalculated.
It also makes the test application DPI-aware as it needs to communicate the current scaling factor to the unit tests. The test application exposes its current DPI scaling in the status bar, and this is read in tests that require checking bounds/positions.
Note that WinAppDriver is also DPI aware so this should also help match the behavior there.