geckodriver
geckodriver copied to clipboard
Unable to click on a <tr> element with multiple cells as children
System
- Version: 0.20
- Platform: Windows 10 & CentOS 7
- Firefox: 59
- Selenium: 3.11.0
HTML Code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Titre</title>
</head>
<body>
<div>
<table style="width: 448px;">
<thead>
<tr>
<th style="width:28px"></th>
<th></th>
</tr>
</thead>
<tbody>
<tr role="option" class="focus" id="FONCTION_1">
<td>L1</td>
<td>Code 1</td>
</tr>
<tr role="option" id="FONCTION_2">
<td>L2</td>
<td>Code 2</td>
</tr>
<tr role="option" id="FONCTION_3">
<td>L3</td>
<td>Code 3</td>
</tr>
<tr role="option" id="FONCTION_4">
<td>L4</td>
<td>Code 4</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
JAVA Code
WebElement row = webDriver().findElement(By.id("FONCTION_1")); row.click();
Stacktrace
org.openqa.selenium.ElementNotInteractableException: Element
Trace-level log
1521817862622 webdriver::server DEBUG <- 400 Bad Request {"value":{"error":"element not interactable","message":"Element <tr id="FONCTION_1" class="focus"> could not be scrolled into view","stacktrace":"Web DriverError@chrome://marionette/content/error.js:172:5\nElementNotInteractableError@chrome://marionette/content/error.js:280:5\nwebdriverClickElement@chrome://marionette/content/interaction.js:160:11\ninteraction.clickEl ement@chrome://marionette/content/interaction.js:131:11\nclickElement/<@chrome://marionette/content/listener.js:1225:14\nnavigate/<@chrome://marionette/content/listener.js:417:13\nnavigate@chrome://marionette/content/lis tener.js:416:13\nclickElement@chrome://marionette/content/listener.js:1224:5\n"}} 1521817897810 webdriver::server DEBUG -> POST /session/b3e4baec-d604-4b2d-b65c-07aba9e17b4f/element/5a4fcfc9-01c4-44fb-aa94-60345d579045/click {"id":"5a4fcfc9-01c4-44fb-aa94-60345d579045"} 1521817897810 geckodriver::marionette TRACE -> 67:[0,10,"clickElement",{"id":"5a4fcfc9-01c4-44fb-aa94-60345d579045"}] 1521817897802 Marionette TRACE 0 -> [0,10,"clickElement",{"id":"5a4fcfc9-01c4-44fb-aa94-60345d579045"}] 1521817897816 Marionette TRACE 0 <- [1,10,{"error":"element not interactable","message":"Element <tr id="FONCTION_1" class="focus"> could not be scrolled int ... avigate@chrome://marionette/content/listener. js:416:13\nclickElement@chrome://marionette/content/listener.js:1224:5\n"},null] 1521817897825 geckodriver::marionette TRACE <- [1,10,{"error":"element not interactable","message":"Element <tr id="FONCTION_1" class="focus"> could not be scrolled into view","stacktrace":"WebDriverError@chrome: //marionette/content/error.js:172:5\nElementNotInteractableError@chrome://marionette/content/error.js:280:5\nwebdriverClickElement@chrome://marionette/content/interaction.js:160:11\ninteraction.clickElement@chrome://mari onette/content/interaction.js:131:11\nclickElement/<@chrome://marionette/content/listener.js:1225:14\nnavigate/<@chrome://marionette/content/listener.js:417:13\nnavigate@chrome://marionette/content/listener.js:416:13\ncl ickElement@chrome://marionette/content/listener.js:1224:5\n"},null] 1521817897825 webdriver::server DEBUG <- 400 Bad Request {"value":{"error":"element not interactable","message":"Element <tr id="FONCTION_1" class="focus"> could not be scrolled into view","stacktrace":"Web DriverError@chrome://marionette/content/error.js:172:5\nElementNotInteractableError@chrome://marionette/content/error.js:280:5\nwebdriverClickElement@chrome://marionette/content/interaction.js:160:11\ninteraction.clickEl ement@chrome://marionette/content/interaction.js:131:11\nclickElement/<@chrome://marionette/content/listener.js:1225:14\nnavigate/<@chrome://marionette/content/listener.js:417:13\nnavigate@chrome://marionette/content/lis tener.js:416:13\nclickElement@chrome://marionette/content/listener.js:1224:5\n"}} 1521817862622 webdriver::server DEBUG <- 400 Bad Request {"value":{"error":"element not interactable","message":"Element <tr id="FONCTION_1" class="focus"> could not be scrolled into view","stacktrace":"Web DriverError@chrome://marionette/content/error.js:172:5\nElementNotInteractableError@chrome://marionette/content/error.js:280:5\nwebdriverClickElement@chrome://marionette/content/interaction.js:160:11\ninteraction.clickEl ement@chrome://marionette/content/interaction.js:131:11\nclickElement/<@chrome://marionette/content/listener.js:1225:14\nnavigate/<@chrome://marionette/content/listener.js:417:13\nnavigate@chrome://marionette/content/lis tener.js:416:13\nclickElement@chrome://marionette/content/listener.js:1224:5\n"}} 1521817897810 webdriver::server DEBUG -> POST /session/b3e4baec-d604-4b2d-b65c-07aba9e17b4f/element/5a4fcfc9-01c4-44fb-aa94-60345d579045/click {"id":"5a4fcfc9-01c4-44fb-aa94-60345d579045"} 1521817897810 geckodriver::marionette TRACE -> 67:[0,10,"clickElement",{"id":"5a4fcfc9-01c4-44fb-aa94-60345d579045"}] 1521817897802 Marionette TRACE 0 -> [0,10,"clickElement",{"id":"5a4fcfc9-01c4-44fb-aa94-60345d579045"}] 1521817897816 Marionette TRACE 0 <- [1,10,{"error":"element not interactable","message":"Element <tr id="FONCTION_1" class="focus"> could not be scrolled int ... avigate@chrome://marionette/content/listener. js:416:13\nclickElement@chrome://marionette/content/listener.js:1224:5\n"},null] 1521817897825 geckodriver::marionette TRACE <- [1,10,{"error":"element not interactable","message":"Element <tr id="FONCTION_1" class="focus"> could not be scrolled into view","stacktrace":"WebDriverError@chrome: //marionette/content/error.js:172:5\nElementNotInteractableError@chrome://marionette/content/error.js:280:5\nwebdriverClickElement@chrome://marionette/content/interaction.js:160:11\ninteraction.clickElement@chrome://mari onette/content/interaction.js:131:11\nclickElement/<@chrome://marionette/content/listener.js:1225:14\nnavigate/<@chrome://marionette/content/listener.js:417:13\nnavigate@chrome://marionette/content/listener.js:416:13\ncl ickElement@chrome://marionette/content/listener.js:1224:5\n"},null] 1521817897825 webdriver::server DEBUG <- 400 Bad Request {"value":{"error":"element not interactable","message":"Element <tr id="FONCTION_1" class="focus"> could not be scrolled into view","stacktrace":"Web DriverError@chrome://marionette/content/error.js:172:5\nElementNotInteractableError@chrome://marionette/content/error.js:280:5\nwebdriverClickElement@chrome://marionette/content/interaction.js:160:11\ninteraction.clickEl ement@chrome://marionette/content/interaction.js:131:11\nclickElement/<@chrome://marionette/content/listener.js:1225:14\nnavigate/<@chrome://marionette/content/listener.js:417:13\nnavigate@chrome://marionette/content/lis tener.js:416:13\nclickElement@chrome://marionette/content/listener.js:1224:5\n"}}
Does this work if you click on either TD element?
Yes it is. But I need to click on tr element for compatibility and in my case some td elements are not visible. In waiting fixing I loop on td while an exception is thrown
I was wondering if it was a similar issue to mine, but it's not. I hope you find a resolution fast. My issue is the page is wrapping my last TD to the next line. The driver thinks the element is not on the screen. I get the same exception. I should probably create a ticket.
Effectively your problem is not the same. Thanks
Basically the underlying issue is Firefox related and tracked as https://bugzilla.mozilla.org/show_bug.cgi?id=1413493. In https://bugzilla.mozilla.org/show_bug.cgi?id=1406505 I added a workaround for that by letting Marionette default to the first contained cell. I wonder why this is not working here.
OK. What do you need to understand why this is not working here ?
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1448825 for that. Thanks for reporting.
This bug still exists. I just stumbled across it. Is it not being fixed? Or is there a workaround?
@Michel73 Seems to be low on their priority list. A workaround I have found is using the Actions object:
action.moveToElement(e).click().perform();
As far as I can tell, it's only needed for TR elements specifically
I'm using WebdriverIO. I already tried e = $('tr'); e.moveTo(); e.click() with no success.
Right, as I mentioned in the comment, you will need to use the Actions object.
Actions action = new Actions(webdriver); action.moveToElement(e).click().perform();
Sorry, I haven't mentioned that I use WebdriverIO with Typescript. There is no such a API, but the error is the same.
I am not familiar with Typescript sorry. The only workaround(s) I have found is the one I mentioned and also clicking the
Thx. My workaround is to select a td within the tr and that works.