Skip to content

Window position values can be negative #404

@yoongu

Description

@yoongu

System Setup:

  • Windows 10
  • Firefox 50.1.0
  • GeckoDriver 0.11.1
  • Selenium 3.0.1

Steps to Reproduce:

  1. Maximize a Firefox window.
  2. Try to get its position.

Symptom:
An exception is raised with the message Failed to interpret x as integer

Likely Explanation:
In Windows 10, a maximized window is not anchored at a zero-coordinate of (0, 0), but at some negative-coordinate like (-8, -8). This can be verified using Windows tools like inspect.exe [1]. And this negative coordinate seems to be what's problematic. At Line 562 of marionette.rs [2], there is an attempt to convert it to an unsigned value -- as_u64() -- which is failing.

[1] https://msdn.microsoft.com/en-us/library/windows/desktop/dd318521.aspx
[2] https://github.com/mozilla/geckodriver/blob/master/src/marionette.rs#L562

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions