"element not interactable" after at-checker

97 views
Skip to first unread message

Ben Frey

unread,
Aug 24, 2020, 2:05:14 PM8/24/20
to Geb User Mailing List
I'm having a devil of a time with one particular page being very flaky. I've set atCheckWaiting = true globally. In the page's at-checker I verify that there there's at least one radio button (e.g. radioButtons.size() > 0). In the script, I have some conditional logic that also has a waitFor that depends on the same condition, but immediately after that, if I try to interact with radioButtons, I get  the "element not interactable" message from Selenium. What's going on here? The content should be there since the at-checker passed.

thok...@gmail.com

unread,
Aug 24, 2020, 4:54:41 PM8/24/20
to Geb User Mailing List
Hi Ben,

this is difficult to answer correctly without more information.
Generally, I would try to narrow down the conditions, or the selector respectively, as much as possible.
One explanation could be that you are still looking at the wrong button, after all you seem to be having more than one, and narrowing it down to the correct one seems to be problematic.

I just recently had the problem that Selenium incorrectly reported "element not interactable" when the problem was in fact that the elemnt was merely outside the viewport. If the element is close to, or beyond, the edge of the screen, try scrolling before interacting with it.

Thomas

Ben Frey

unread,
Aug 24, 2020, 5:16:20 PM8/24/20
to Geb User Mailing List
Ahh, I hadn't thought about the viewport. I'll play with that and see how it goes. I also added min properties to the radioButtons navigator object, and that seems like it may have helped.

Marcin Erdmann

unread,
Aug 26, 2020, 4:36:52 AM8/26/20
to geb-...@googlegroups.com
> Selenium incorrectly reported "element not interactable" when the problem was in fact that the elemnt was merely outside the viewport. If the element is close to, or beyond, the edge of the screen, try scrolling before interacting with it.

This is not what matches my personal experience. I've never experienced ElementNotInteractableException for an element that was outside of viewport - Selenium pretty much always scrolls the viewport so that element is visible before clicking it and when it fails to do that because there are floating elements on the page you would get something along the lines of "org.openqa.selenium.WebDriverException: Element is not clickable at point (x, y). Other element would receive the click". From my experience ElementNotInteractableException is thrown when the element is not displayed at all (it is hidden via CSS) or it's disabled/read only.

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/08ae974a-ecc5-440a-b246-10e2703f4e70n%40googlegroups.com.

tho...@posteo.de

unread,
Aug 26, 2020, 8:40:14 AM8/26/20
to geb-...@googlegroups.com, Marcin Erdmann
I know for sure I had this case very recently, where the "element not
interactable" error occured, and the element was outside the viewport,
and it also didn't scroll automatically to that element.
I remember this clearly, because I could not figure out the problem,
until I actually found an answer on stackoverflow (not the first answer
to that question, though), that suggested to watch out for scrolling.
It was only because of this that I realised that the element was in fact
outside the viewport, and explicit scrolling made the problem go away.
The application that I am testing is very old, close to 20 year, and
there are many problems with the UI, like buttons and UI elements
visibly changing after the page has loaded, so it could definitely be
some weird edge case.

I definitely agree to Marcin, that this is by no means a common
occurrence, and most of the time, the element is in fact not
interactable, i.e. disabled, when this error comes.
> [1].
>
> --
> You received this message because you are subscribed to the Google
> Groups "Geb User Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to geb-user+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/geb-user/CA%2B52dQR4LgiqYiw3JY_4Civ4k%3DqfLVM9agCjZwcnwj88bk6N9w%40mail.gmail.com
> [2].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/geb-user/08ae974a-ecc5-440a-b246-10e2703f4e70n%40googlegroups.com?utm_medium=email&utm_source=footer
> [2]
> https://groups.google.com/d/msgid/geb-user/CA%2B52dQR4LgiqYiw3JY_4Civ4k%3DqfLVM9agCjZwcnwj88bk6N9w%40mail.gmail.com?utm_medium=email&utm_source=footer

Ben Frey

unread,
Aug 26, 2020, 9:02:28 AM8/26/20
to Geb User Mailing List
I did try scrolling, but it didn't help the problem. I've tried watching closely when the error occurs, and it doesn't seem like the page is fully loaded, even though I have min: 6, wait: true on the content.

Ben Frey

unread,
Aug 27, 2020, 1:41:38 PM8/27/20
to Geb User Mailing List
I think that checking if a specific radio button is displayed (radioButtons[5].displayed) has fixed the issue.
Reply all
Reply to author
Forward
0 new messages