Closed Danp2 closed 1 year ago
Until there is Scroll Into View support for Actions, the easiest way to resolve this is with Javascript --
_WD_ExecuteScript($sSession, "arguments[0].scrollIntoView(false);", __WD_JsonElement($sElement))
Sleep(500)
The short sleep is to allow time for the window to scroll before continuing. I was able to scroll the browser window with Wheel actions, but attempts to scroll in relation to the target element failed --
{"actions":[{"id":"scroll","type":"wheel","actions":[{"type":"scroll", "duration":100,"x":0,"y":0, "deltaX":0, "deltaY":0, "origin":{"ELEMENT":"dd776eaa-a915-4332-b3ca-532985074fe3","element-6066-11e4-a52e-4f735466cecf":"dd776eaa-a915-4332-b3ca-532985074fe3"}}]}]}
resulted in this --
{ "value": { "error": "move target out of bounds", "message": "(640, 1854) is out of bounds of viewport width (1282) and height (982)", "stacktrace": "RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8\nWebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:182:5\nMoveTargetOutOfBoundsError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:372:5\nassertInViewPort@chrome://remote/content/marionette/action.sys.mjs:2113:11\ndispatch@chrome://remote/content/marionette/action.sys.mjs:1149:21\ndispatch/pendingEvents<@chrome://remote/content/marionette/action.sys.mjs:1827:14\ndispatch@chrome://remote/content/marionette/action.sys.mjs:1826:39\ndispatch/chainEvents<@chrome://remote/content/marionette/action.sys.mjs:1753:27\ndispatch@chrome://remote/content/marionette/action.sys.mjs:1755:7\nperformActions@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:472:23\nreceiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:139:31\n" }
}
@Danp2 was there discussion on Au3Forum ? Did I made an bypass fix for this ? Can you point here this discussion and my fix ?
There was related discussion in #402. Perhaps that is what you remember?
Bug report
Describe the bug
_WD_ElementActionEx doesn't scroll the target element into view, which can lead to failure of some webdriver actions.
How to reproduce
Run the following in wd_demo's UserTesting function --
Here's the corresponding logs --
Expected behavior
Element to be scrolled into view as needed and mouse to hover over the target element
Additional context
https://github.com/w3c/webdriver/issues/1005