-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Not correctly move pointer to the position inside of element in bridge mode. #6332
Comments
I have this same issue as well with Selenium 4.0.0-alpha.1 / Mocha 5.2.0 / ES6. Used it for long time but never encountered the issue until now:
|
upsss.. found the issue: |
For current (4.0.0-alpha.5) webdriver: The script below will work in Firefox, but not in Chrome, despite having bridge mode on. I suspect it's the same issue as OP's, since I'm trying to work with a canvas element, too. To ReproduceOn an arbitrary OpenLayers map, e.g. https://openlayers.org/en/latest/examples/accessible.html, run // In an async function
const viewport = await driver.findElement(By.css(".ol-viewport"));
await driver.actions({bridge: true})
.move({origin: viewport})
.press(webdriver.Button.LEFT)
.move({origin: viewport, x: 10, y: 10})
.release(webdriver.Button.LEFT)
.perform(); Expected behaviorMap should pan. Happens in Firefox, but not in Chrome. (Hence I assume it's a bug regarding bridge mode.) EnvironmentOS: Windows 10 About FixThe fix as outlined by OP (adding parseInt) does not work for me. If any reader knows about a workaround, please let me know. |
If this is working in Firefox and not in Chrome, it might be a Chrome/ChromeDriver issue. Is this issue still happening with the most recent versions of Firefox, Chrome and Selenum WebDriver? |
Closing this as we did not get more information, please feel free to open a new issue if the problem still persists after trying with the most recent versions. |
Meta -
OS: Windows 8
Selenium Webdriver: 4.0.0-alpha.1
Browser: Chrome
Browser Version: 68.0.3440.106
Expected Behavior -
I am trying move pointer to the position inside of canvas element in bridge mode.
Actual Behavior -
Pointer moved to the center of canvas element.
Steps to reproduce -
How I fix it -
selenium/javascript/node/selenium-webdriver/lib/input.js
row: 1148
x and y returned float. Simple parseInt() resolve this problem.
Documentation -
http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/input_exports_Actions.html
You write:
"6. For W3C actions, move offsets relative to a WebElement are interpretted relative to the center of an element's first client rect in the viewport. For legacy actions, element offsets are relative to the top-left corner of the element's bounding client rect. When translating actions to the legacy protocol in bridge mode, an extra command must be inserted to translate move offsets from one frame of reference to the other. This extra command conributes to the overall latency issue outlined in point 1."
BUT you alredy do it in selenium/javascript/node/selenium-webdriver/lib/input.js; row: 1144 and no extra command must be inserted to translate move offsets.
The text was updated successfully, but these errors were encountered: