Failure: Element could not be scrolled into view

Good Morning!

I am new to web ui automation. I have recorded a test and during playback, one of my close window objects throws this error. Other places where this object is used works fine. Any suggestions?

=============== ROOT CAUSE =====================
Caused by: org.openqa.selenium.ElementNotInteractableException: Element could not be scrolled into view
At object: ‘Object Repository/Beacon/Web UI/Page_Order/i_close’

Well, on first glance it sounds as though the element is off screen.

Try this before that step:

Thanks for your response Russ! I tried this and no luck. Its finding the element based on what I see here…

Strange.

Okay, let’s try this - replace the WebUI.click() call with WebUI.enhancedClick()

If THAT doesn’t work, kick the computer very hard send me the code you’re using and a screenshot of the HTML layout from DevTools.

haha! I kicked the computer several times and it only made things worse!

But the good news is that the enhancedClick worked!!! I added it to the button close and to the next instruction to click button view details.

However, the button close took a long time – this message was displayed…
Trying to scroll to the element, wait for it to be clickable and use Selenium click !

Also, why does the “click” option work for some windows with the button_close object but not others?

Thank you so much for your help!

Yes, there are definitely issues in there somewhere. I’ll need to see more of the code and screenshots of the HTML (like I said).

In the meantime, be aware enhancedClick falls back on using JavaScript code to “force” the click whereas the Katalon/Selenium code is trying to behave like a human (you can’t click on something you can’t see). JavaScript, can.

If you’re convinced the element is visible at that point, go ahead, move on, we’re done here. If however the element is off-screen, you should deal with the issue properly (whatever that turns out to be). Like I said, there’s something screwy in there somewhere.

If (that’s a BIG IF) you’re convinced to move on, you can remove the scroll to element call.

Because enhancedClick is trying “everything” before it eventually tries JavaScript. You probably have Smart Wait involved here, too.

Sunspots? It doesn’t like you? Who knows… (Ask me an easier one).

Seriously, it’s not a valid test if you let this go and that close button is NOT visible.

1 Like

Ill post more info after my vacation (back on 12/28). Thank you for all your help. I am just getting my feet wet so Im sure Ill have more questions too.