Open hqbrice opened 6 years ago
Judging by the error message (2008, 408) is out of bounds of viewport width (1920) and height (966)
, I’m not sure this is a geckodriver bug. The X coordinate 2008 is larger than the viewport’s width, which means the pointer can’t be positioned there.
Am I missing anything?
Possible : 1920x966 seems to match with the resolution screen, The div width is 1000 but the picture inside width is 5444. I need click on picture at x=1500 (this is hidden by scroll but reachable).
On FF 57 this scroll the div.
Else, how can I click on picture at x = 1500 ? Thanks
Of course, even if I scroll manually to xOffset = 1500 on the screen, the exception is thrown
@hqbrice can you please also check the latest Firefox 58 beta if it also misbehaves? If there is a real regression we might still have the time to get this fixed.
I can reproduce and as it looks like this is caused by https://bugzilla.mozilla.org/show_bug.cgi?id=1393831. I will file a bug for that. Thanks for reporting!
I filed the regression bug as https://bugzilla.mozilla.org/show_bug.cgi?id=1429338. CC @mjzffr
I also tried on V58 with 0,0, it's easier to get coordonate. So, contrary to what is saied in javadoc, Gecko compute coordinate from the center of the element where Chrome Driver from top left corner.
When I try 0,0 (the center of the picture), I wait click on 2722 and 2041,5 from top left but click is at 3267.5 and 2053.5. You are right, it looks like a bad coordinates computing.
Now, I wait V59 release to use doubleclic and regression fixing.
Thanks
Hm, sounds like this is related to https://github.com/w3c/webdriver/issues/1171, and that we cannot return to top/left? @andreastt am I right, and this is an expected behavior now?
Yes, the default for the pointerMove
action is the centre point of the element as far as I know, and we can’t change that now because it is in the specification and in implementations… I believe @mjzffr has better insight than me on this matter.
If you change this now, many users will be impacted...
There is a contradiction into the Actions class of selenium (org.openqa.selenium.interactions.Actions). The Javadoc says "Moves the mouse to an offset from the top-left corner of the element." but there is a log info which says LOG.info("When using the W3C Action commands, offsets are from the center of element");
May be the Chrome driver has to update their method. I have also open an issue for a problem like this one, but no answer for 2 days...
AFAIK the chrome driver still doesn't use the webdriver spec implementation by default. There should be a separate flag for it.
Chrome driver seems late... Unfortunately
For now we backed out the changes from bug 1393831 for Firefox 58. It means the old behavior should be back with the next beta release. @hqbrice would you mind moving further discussion to https://bugzilla.mozilla.org/show_bug.cgi?id=1429338 in case you want to create an account on Bugzilla? If not we will have to continue on this issue.
We will have some questions in a bit...
@hqbrice for now I would like to know which selenium binding you are using. And would you mind to run the following test just with your binding? https://bug1429338.bmoattachments.org/attachment.cgi?id=8941588 A tracelog from that execution would be kinda appreciated. Thanks.
No, you can move the discussion to bugzilla
What do you need by " which selenium binding " ?
I use Selenium standalone and giving the geckodriver path. And instance driver by :
DesiredCapabilities capability = new DesiredCapabilities(); capability.setBrowserName(navigateur.toString()); FirefoxOptions firefoxOptions = new FirefoxOptions(); firefoxOptions.setLogLevel(FirefoxDriverLogLevel.TRACE); if (isTestEnv()) {firefoxOptions.addArguments("--headless");} capability.setCapability(FirefoxOptions.FIREFOX_OPTIONS, firefoxOptions); WebDriver webDriver = new RemoteWebDriver(new URL(url), capability);
On V58 : action.moveToElement(pic).click().perform(); --> click on element, but red circle doesn't move
action.moveToElement(pic, 0, 0).click().perform(); --> click on element when the center of the picture is visible but the click does not happen at center
Which language is that? Java, C#, ...
Also please attach a tracelevel log from the code you run in the last comment. Thanks.
Oh, and as best use my example testcase as referenced above on Bugzilla.
Language is Java
This ar 3 logs
1) action.moveToElement(pic).click().perform();
14:29:50.279 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@18d6145d 14:29:50.279 INFO - Handler thread for session 2a6fbd7f-34a8-492d-b55a-d7bcc4469c9b (firefox): Executing POST on /session/2a6fbd7f-34a8-492d-b55a-d7bcc4469c9b/actions (handler: ServicedSession) 14:29:50.311 INFO - To upstream: {"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"4f2bd04c-b14f-4e3f -859d-1f0aaf798354","element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354"}},{"button":0,"type":"pointerDown"},{"button":0,"type":"pointerUp"}]}]} 1515677390311 webdriver::server DEBUG -> POST /session/2a6fbd7f-34a8-492d-b55a-d7bcc4469c9b/actions {"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration" :100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354","element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354"}},{"button":0,"type":"pointerDown"},{"button": 0,"type":"pointerUp"}]}]} 1515677390326 geckodriver::marionette TRACE -> 330:[0,34,"performActions",{"actions":[{"actions":[{"duration":100,"origin":{"element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354"},"type":"pointe rMove","x":0,"y":0},{"button":0,"type":"pointerDown"},{"button":0,"type":"pointerUp"}],"id":"default mouse","parameters":{"pointerType":"mouse"},"type":"pointer"}]}] 1515677390321 Marionette TRACE 0 -> [0,34,"performActions",{"actions":[{"actions":[{"duration":100,"origin":{"element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f ... pointerDown"},{"button":0,"type":"pointerUp"} ],"id":"default mouse","parameters":{"pointerType":"mouse"},"type":"pointer"}]}] 1515677390501 Marionette TRACE 0 <- [1,34,null,{}] 1515677390514 geckodriver::marionette TRACE <- [1,34,null,{}] 1515677390514 webdriver::server DEBUG <- 200 OK {"value": {}} 14:29:50.514 INFO - To downstream: {"value": {}}
2) action.moveToElement(pic, 0, 0).click().perform(); when picture isn't scrolled at center
14:30:13.955 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@18d6145d 14:30:13.955 INFO - Handler thread for session 2a6fbd7f-34a8-492d-b55a-d7bcc4469c9b (firefox): Executing POST on /session/2a6fbd7f-34a8-492d-b55a-d7bcc4469c9b/actions (handler: ServicedSession) 14:30:13.955 INFO - To upstream: {"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"4f2bd04c-b14f-4e3f -859d-1f0aaf798354","element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354"}},{"button":0,"type":"pointerDown"},{"button":0,"type":"pointerUp"}]}]} 1515677413955 webdriver::server DEBUG -> POST /session/2a6fbd7f-34a8-492d-b55a-d7bcc4469c9b/actions {"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration" :100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354","element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354"}},{"button":0,"type":"pointerDown"},{"button": 0,"type":"pointerUp"}]}]} 1515677413971 geckodriver::marionette TRACE -> 330:[0,35,"performActions",{"actions":[{"actions":[{"duration":100,"origin":{"element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354"},"type":"pointe rMove","x":0,"y":0},{"button":0,"type":"pointerDown"},{"button":0,"type":"pointerUp"}],"id":"default mouse","parameters":{"pointerType":"mouse"},"type":"pointer"}]}] 1515677413972 Marionette TRACE 0 -> [0,35,"performActions",{"actions":[{"actions":[{"duration":100,"origin":{"element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f ... pointerDown"},{"button":0,"type":"pointerUp"} ],"id":"default mouse","parameters":{"pointerType":"mouse"},"type":"pointer"}]}] 1515677414131 Marionette TRACE 0 <- [1,35,null,{}] 1515677414142 geckodriver::marionette TRACE <- [1,35,null,{}] 1515677414142 webdriver::server DEBUG <- 200 OK {"value": {}}
3) action.moveToElement(pic, 0, 0).click().perform(); when picture is scrolled at center
14:31:04.097 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@18d6145d 14:31:04.097 INFO - Handler thread for session 2a6fbd7f-34a8-492d-b55a-d7bcc4469c9b (firefox): Executing POST on /session/2a6fbd7f-34a8-492d-b55a-d7bcc4469c9b/actions (handler: ServicedSession) 14:31:04.175 INFO - To upstream: {"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"4f2bd04c-b14f-4e3f -859d-1f0aaf798354","element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354"}},{"button":0,"type":"pointerDown"},{"button":0,"type":"pointerUp"}]}]} 1515677464191 webdriver::server DEBUG -> POST /session/2a6fbd7f-34a8-492d-b55a-d7bcc4469c9b/actions {"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration" :100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354","element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354"}},{"button":0,"type":"pointerDown"},{"button": 0,"type":"pointerUp"}]}]} 1515677464191 geckodriver::marionette TRACE -> 330:[0,37,"performActions",{"actions":[{"actions":[{"duration":100,"origin":{"element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f-4e3f-859d-1f0aaf798354"},"type":"pointe rMove","x":0,"y":0},{"button":0,"type":"pointerDown"},{"button":0,"type":"pointerUp"}],"id":"default mouse","parameters":{"pointerType":"mouse"},"type":"pointer"}]}] 1515677464189 Marionette TRACE 0 -> [0,37,"performActions",{"actions":[{"actions":[{"duration":100,"origin":{"element-6066-11e4-a52e-4f735466cecf":"4f2bd04c-b14f ... pointerDown"},{"button":0,"type":"pointerUp"} ],"id":"default mouse","parameters":{"pointerType":"mouse"},"type":"pointer"}]}] 1515677464445 Marionette TRACE 0 <- [1,37,null,{}] 1515677464456 geckodriver::marionette TRACE <- [1,37,null,{}] 1515677464456 webdriver::server DEBUG <- 200 OK {"value": {}}
System
1500, 150 become 2008,408 because this is computed from the center of the img element.
Page
Testcase
Actions action = new Actions(driver); WebElement pic=webDriver.findElement(By.id("picture")); action.moveToElement(pic, 1500, 150).click().build().perform();
Stacktrace
org.openqa.selenium.interactions.MoveTargetOutOfBoundsException: (2008, 408) is out of bounds of viewport width (1920) and height (966) Build info: version: '3.8.1', revision: '8a0099a', time: '2017-11-06T21:01:39.354Z' System info: host: 'WS-R0-BR01', ip: '10.1.19.157', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91' Driver info: org.openqa.selenium.remote.RemoteWebDriver Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 59.0a1, javascriptEnabled: true, moz:accessibilityChecks: false, moz:headless: false, moz:processID: 3104, moz:profile: C:\Users\admin\AppData\Loca..., moz:webdriverClick: true, pageLoadStrategy: normal, platform: XP, platformName: XP, platformVersion: 6.1, rotatable: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}} Session ID: 6f5e3af3-56eb-4bb2-a240-5f20c97db372 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600) at org.openqa.selenium.remote.RemoteWebDriver.perform(RemoteWebDriver.java:666) at org.openqa.selenium.interactions.Actions$BuiltAction.perform(Actions.java:638) )
Trace-level log