"WebDriver:ElementClick" fails for SVG <g> elements because it's not in the pointer-interactable paint tree
Categories
(Remote Protocol :: Marionette, defect, P3)
Tracking
(Not tracked)
People
(Reporter: evgeniy_mea, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Whiteboard: [webdriver:backlog])
Attachments
(1 file, 2 obsolete files)
219 bytes,
text/plain
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
Steps to reproduce:
FireFoxDriver:
- driverVersion - 81.0
- seleniumVersion - 3.141.59
- os - windows 10
- java.version: '1.8.0_221'
Steps:
-
Find webElement with tag <g> (dom is in attachment)
-
Execute - weElement.click
Actual results:
org.openqa.selenium.ElementNotInteractableException: Element <g id="__GTOODg8__seat:17" class="branded"> could not be scrolled into view
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
Expected results:
Click on <g> must be executable.
Reporter | ||
Updated•4 years ago
|
Comment hidden (off-topic) |
Reporter | ||
Comment 2•4 years ago
|
||
Its strange.
I send webElement.click()
to webElement with tag <g>.
In chromeDriver its works fine, but firefox get this error.
In crossBrowser testing its look like crutch.
Comment hidden (off-topic) |
Comment hidden (off-topic) |
Comment 5•4 years ago
|
||
Please note that the reporter is referencing the click()
method in Selenium, which actually maps to Element Click in the WebDriver specification. Basically click should work but as the error could not be scrolled into view
says the element is outside of the viewport and cannot be scrolled into it.
Please create a trace log for geckodriver and attach the output on this bug. Also which web site are you testing here? If it's not publicly available can you create a minimized HTML? Thanks.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 6•4 years ago
|
||
1601561280870 webdriver::server DEBUG -> POST /session/09094df7-2aec-42cd-991b-0ce83556010a/execute/sync {
"script": "arguments[0].style.border='4px solid red'",
"args": [
{
"ELEMENT": "db0a0124-75ed-467d-9d24-72337ff7dbff",
"element-6066-11e4-a52e-4f735466cecf": "db0a0124-75ed-467d-9d24-72337ff7dbff"
}
]
}
1601561280872 Marionette DEBUG 0 -> [0,357,"WebDriver:ExecuteScript",{"args":[{"ELEMENT":"db0a0124-75ed-467d-9d24-72337ff7dbff","element-6066-11e4-a52e-4f735466cecf":"db0a0124-75ed-467d-9d24-72337ff7dbff"}],"script":"arguments[0].style.border='4px solid red'"}]
1601561280878 Marionette DEBUG 0 <- [1,357,null,{"value":null}]
1601561280878 webdriver::server DEBUG <- 200 OK {"value":null}
1601561280902 webdriver::server DEBUG -> POST /session/09094df7-2aec-42cd-991b-0ce83556010a/execute/sync {
"script": "arguments[0].scrollIntoView(true);",
"args": [
{
"ELEMENT": "db0a0124-75ed-467d-9d24-72337ff7dbff",
"element-6066-11e4-a52e-4f735466cecf": "db0a0124-75ed-467d-9d24-72337ff7dbff"
}
]
}
1601561280904 Marionette DEBUG 0 -> [0,358,"WebDriver:ExecuteScript",{"args":[{"ELEMENT":"db0a0124-75ed-467d-9d24-72337ff7dbff","element-6066-11e4-a52e-4f735466cecf":"db0a0124-75ed-467d-9d24-72337ff7dbff"}],"script":"arguments[0].scrollIntoView(true);"}]
1601561280907 Marionette DEBUG 0 <- [1,358,null,{"value":null}]
1601561280907 webdriver::server DEBUG <- 200 OK {"value":null}
1601561280917 webdriver::server DEBUG -> POST /session/09094df7-2aec-42cd-991b-0ce83556010a/element/db0a0124-75ed-467d-9d24-72337ff7dbff/click {
"id": "db0a0124-75ed-467d-9d24-72337ff7dbff"
}
1601561280918 Marionette DEBUG 0 -> [0,359,"WebDriver:ElementClick",{"id":"db0a0124-75ed-467d-9d24-72337ff7dbff"}]
1601561280927 Marionette DEBUG 0 <- [1,359,{"error":"element not interactable","message":"Element <g id="__GTOODg8__seat:24" class="branded"> could not be sc ... vigate@chrome://marionette/content/listener.js:447:11\nclickElement@chrome://marionette/content/listener.js:1331:24\n"},null]
1601561280926 webdriver::server DEBUG <- 400 Bad Request {"value":{"error":"element not interactable","message":"Element <g id="__GTOODg8__seat:24" class="branded"> could not be scrolled into view","stacktrace":"WebDriverError@chrome://marionette/content/error.js:175:5\nElementNotInteractableError@chrome://marionette/content/error.js:285:5\nwebdriverClickElement@chrome://marionette/content/interaction.js:159:11\ninteraction.clickElement@chrome://marionette/content/interaction.js:131:11\nclickElement/<@chrome://marionette/content/listener.js:1333:28\nnavigate@chrome://marionette/content/listener.js:447:11\nclickElement@chrome://marionette/content/listener.js:1331:24\n"}}
Reporter | ||
Comment 7•4 years ago
|
||
Reporter | ||
Comment 8•4 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #5)
Please note that the reporter is referencing the
click()
method in Selenium, which actually maps to Element Click in the WebDriver specification. Basically click should work but as the errorcould not be scrolled into view
says the element is outside of the viewport and cannot be scrolled into it.Please create a trace log for geckodriver and attach the output on this bug. Also which web site are you testing here? If it's not publicly available can you create a minimized HTML? Thanks.
Part of html and geckoTrace attached.
Comment 9•4 years ago
|
||
The problem here is that the SVG group element (g
) is not part of the paint tree (elementsFromPoint), and as such it's marked as not interactable. If you would interact with the text element instead, the click would work.
Here the paint tree for the minimized HTML:
<text id="text">
<svg>
<body>
<html>
Sean, could you please help us to understand why g
doesn't appear in the paint tree? Looks like Chrome does it, so that we have a web compat issue here. Thanks.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 10•4 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #9)
Sean, could you please help us to understand why
g
doesn't appear in the paint tree? Looks like Chrome does it, so that we have a web compat issue here. Thanks.
Maybe longsonr or heycam can answer this.
Comment 11•4 years ago
|
||
Because it's just a container (unless it has the style pointer-events: bounding-box, which Firefox does not currently support). You can only click on a container's contents modulo the aforementioned special value for pointer-events.
Comment 12•4 years ago
|
||
Ok, so we determine the element interactability here:
https://searchfox.org/mozilla-central/rev/222e4f64b769413ac1a1991d2397b13a0acb5d9d/testing/marionette/element.js#1152-1169
It means we set pointerEvents
of the element to auto
. Would that cover a possible later implementation of pointer-events: bounding-box
at a later time without having to modify the Marionette code? If yes, is there a bug for getting pointer-events: bounding-box
support added to Firefox?
Updated•4 years ago
|
Comment 13•4 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #12)
is there a bug for getting
pointer-events: bounding-box
support added to Firefox?
Actually this is bug 945187.
evgeniy_meaFire, if you want to get it working you have two options right now:
- Change your code to not click on the group but the
text
element. That should work cross-browser. - Turn off the
moz:webDriverClick
capability. But then you won't have actual WebDriver behavior forElement Click
.
Reporter | ||
Comment 14•4 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #13)
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #12)
is there a bug for getting
pointer-events: bounding-box
support added to Firefox?Actually this is bug 945187.
evgeniy_meaFire, if you want to get it working you have two options right now:
- Change your code to not click on the group but the
text
element. That should work cross-browser.- Turn off the
moz:webDriverClick
capability. But then you won't have actual WebDriver behavior forElement Click
.
Thank you!
But will this issue fied?
Comment 15•4 years ago
|
||
(In reply to evgeniy_meaFire from comment #14)
But will this issue fied?
It depends on the progress on bug 945187. But that's outside of my scope.
Updated•4 years ago
|
Comment 16•4 years ago
|
||
Note that pointer-events: auto is the same as pointer-events: visiblePainted with or without bounding-box support so setting it to auto won't help.
Comment 17•4 years ago
|
||
We currently have auto
set. Would all
be a better option then?
Comment 18•4 years ago
|
||
Wouldn't sending clicks to visibility: hidden elements be surprising? Does Chrome allow visibility:hidden elements to be targetted?
Comment 19•4 years ago
|
||
Yes, synthesizing the click on a group element triggers the click event. I assume that happens because via Selenium a click happens not on the element but at a point on screen, and as such it would fall through to the text
node. Given that g
is part of the paint tree in Chrome the click doesn't cause a not interactable
error.
Updated•2 years ago
|
Updated•1 year ago
|
Description
•