When using geckodriver 0.15.0, move_to_element_with_offset throws an error of "non-positive integer" when x,y offsets are both positive

RESOLVED DUPLICATE of bug 1347658

Status

Testing
Marionette
RESOLVED DUPLICATE of bug 1347658
8 months ago
8 months ago

People

(Reporter: Vickie, Unassigned)

Tracking

52 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

41.44 KB, text/plain
Details
(Reporter)

Description

8 months ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20170323105023

Steps to reproduce:

I tried to open google map with Firefox and click on coordinate (300,300) on the map. I tried to use ActionChains.move_to_element_with_offset to accomplish this. It works fine in Chromedriver but not in Geckodriver. move_to_element(to_element) works fine in Geckodriver but move_to_element_with_offset(to_element, xoffset, yoffset) does not work.

Environment:
windows 7
Firefox 52
Selenium 3.3.1
Python 3.4

Test case:

from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

firefox_capabilities = DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True
driver = webdriver.Firefox(capabilities=firefox_capabilities)
driver.get("https://www.google.com/maps/@34.052713,-117.15077,12z")
wait = WebDriverWait(driver, 40)
canvas = wait.until(EC.visibility_of_element_located((By.XPATH,"//canvas")))
ActionChains(driver).move_to_element_with_offset(canvas,300,300).click().perform()


Actual results:

It throws exception: 
selenium.common.exceptions.WebDriverException: Message: Parameter 'x' was not a positive integer.


Expected results:

Expected behavior:
Mouse move to coordinate (300,300) of the canvas element and perform click action.
Hi Vickie, thank for the report. 

It sounds like a bug that should already be fixed in Firefox 52 (https://bugzilla.mozilla.org/show_bug.cgi?id=1347658). 
* Does your test case run correctly in Firefox Nightly?
* If it doesn't, then please run your test case with "trace" logging level (set this in firefox capabilities using your client API, {"moz:firefoxOptions": {"logging": "level": "trace"}}}) and attach the logs to this bug.
Flags: needinfo?(vskyberry)
(Reporter)

Comment 2

8 months ago
Created attachment 8852700 [details]
geckodriver.log

Error log from geckodriver.
Flags: needinfo?(vskyberry)
(Reporter)

Comment 3

8 months ago
Thank you very much Maja for your reply!!!

I just installed Firefox Nightly and the issue still occurs to me. I don't really know how to run the test case with "trace" logging level. Is there any doc on how this feature is defined and to be used?

I can only set log this way: firefox_capabilities['loggingPrefs'] = { 'browser':'ALL' }. But I guess this is not what you meant...
Flags: needinfo?(mjzffr)
(Reporter)

Comment 4

8 months ago
Created attachment 8852710 [details]
newgeckodriver.log

I think I just enabled "trace" logging level and updated attached log file. Please let me know if this is what you expect.

Thank you!!!
Attachment #8852700 - Attachment is obsolete: true
Flags: needinfo?(mjzffr)
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1347658
Thanks for the trace-level log, Vickie, it confirms what you described. This issue is indeed fixed, and the fix will take effect with the next geckodriver release (0.16).
You need to log in before you can comment on or make changes to this bug.