Element could not be scrolled into view

Hi, brand new to Katalon here, and have set up a test script to automate submission of an HTML form.

The HTML form has multiple fieldsets and each fieldset appears on the screen individually. The user hits a NEXT button and the next fieldset appears. It gives the appearance of a multipage form, but it’s all contained in one HTML with many fieldsets. There is only one NEXT element for the form even though it appears in each fieldset. jQuery handles the page handling upon click of NEXT.

I’m getting the following error in Firefox. Also tested in Chrome and the script stops at the same point.
_
Test Cases/Apartment FAILED because (of) Unable to click on object ‘Object Repository/apartment/Page_Zx Apartment Survey Valuati/input_next’ (Root cause: org.openqa.selenium.ElementNotInteractableException: Element could not be scrolled into view_

The error occurs on page 2 of the form, and it did work successfully on page 1.

When it says ‘could not be scrolled into view’ does that mean that the browser window needs to be expanded or is this another issue?

Any ideas welcome, thanks. Looks like a great tool and I’d love to use it!

Hi, Even I am facing similar issue. Any help will be appreciated.

Hi all,

For this case, I would suggest using ‘Scroll To Element’ keyword to scroll to that button first.

Regards

2 Likes

Hello,

I am also getting the same error, when I am trying to access a ‘sub-menu’ option which is available in an expanded list.
Using the methods in the following sequence to click on a sub-menu option:
1. Mouse over(Parent menu item)
2. Scroll to element(Sub-menu item)
3. Click (Sub-menu item)

1st and 2nd steps are successful and the element is identified using the xpath.

But, when trying to execute the ‘Click’ event, I am getting the following error.
Root cause: org.openqa.selenium.ElementNotInteractableException: Element could not be scrolled into view

Katalon version - 5.4.0

Any ideas on how to fix this issue?

Thanks heaps

1 Like

Me to :frowning:

Hi,

I’m using my custom keyword code to face this problem.
what the code does, is getting a string that represents the element we want to scroll to property (in my code text), and uses javascripit to scroll until the element is present.
one note, you have to be sure your element exists! if the element you are looking for does not exist you will be stuck in an end less loop…

my code:

@Keyword

def scrollToElement(string value)

{

WebDriver driver = DriverFactory.getWebDriver() // get the running driver

JavascriptExecutor executor = ((driver) as JavascriptExecutor) // create a JS executor using the running driver

TestObject to = new TestObject()

to.addProperty(“text”, ConditionType.EQUALS, value) // add property value to element: text - use whatever property you’d like.

executor.executeScript(“window.scrollBy(0,2500)”, “”); // scroll down in the page (to scroll up use: [“window.scrollBy(0,-2500)”, “”] )

while(!WebUI.verifyElementPresent(to, 1, FailureHandling.OPTIONAL)) // as long as the element isn’t showing continue scrolling down.

{

executor.executeScript(“window.scrollBy(0,2500)”, “”);

}

WebUI.click(to)

}

Vinh Nguyen said:

Hi all,

For this case, I would suggest using ‘Scroll To Element’ keyword to scroll to that button first.

Regards

Amdi said:

Hello,

I am also getting the same error, when I am trying to access a ‘sub-menu’ option which is available in an expanded list.
Using the methods in the following sequence to click on a sub-menu option:
1. Mouse over(Parent menu item)
2. Scroll to element(Sub-menu item)
3. Click (Sub-menu item)

1st and 2nd steps are successful and the element is identified using the xpath.

But, when trying to execute the ‘Click’ event, I am getting the following error.
Root cause: org.openqa.selenium.ElementNotInteractableException: Element could not be scrolled into view

Katalon version - 5.4.0

Any ideas on how to fix this issue?

Thanks heaps

Hello Amdi and Vinh,

I have this problem too but only in Firefox. In Edge and Chrome works normally, either by clicking directly on the desired object, or by doing that step by step indicated there.

Hi all,
I have the same issue. Our website is done in WordPress and it has and tags on each page. All links in Header and Footer are not accessible through Katalon. It can “verify the element is present”, it can scroll to that element, but when it try to _click_ on that element, it fails giving the following error message:

Unable to click on object ‘Object Repository/Header/a_What We Do’ (Root cause: org.openqa.selenium.ElementNotInteractableException: Element could not be scrolled into view
It is on the top of the page, and it is visible all the time…
NOTE: I don’t have any issues clicking on any footer/header elements using Eclipse/Selenium environment…
Any idea/tricks how to make it work?

I am having the same issue. Anybody have solution?

Can anyone please help on this its a very important issue and still no solution for this problem.please help us

My dear friends

I had the same issue and I could solve it by giving a delay to each command execution via Project>Settings>Excution>Defaut>Web UI> Delay between actions in seconds.
2 seconds delay was enough for me, but it makes the whole test slow!
I am still looking forward to finding a better solution.

Hope it is useful for you.

Best
Pooya

I solved it by adding a “Wait For Element Visible” step in the test case just before using that particular element. That way you won’t have to delay all executions as advised by Pooya.

2 Likes

Hi, there, did anyone has other solutions? I am facing same issue for

  • element. It is visible, can be found and I have added also Scroll to Element command and element is scrolled but still, sometimes my test fails at click test step and shows following error:

    Unable to click on object ‘Object Repository/NewBooking/a_New booking’ (Root cause: org.openqa.selenium.ElementNotInteractableException: Element

  • could not be scrolled into view
  • Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

    System info: host: ‘ANDREEA’, ip: ‘10.10.10.197’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’

    Driver info: com.kms.katalon.core.webui.driver.firefox.CGeckoDriver

    Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 63.0.1, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.23.0, moz:headless: false, moz:processID: 16472, moz:profile: C:\Users\andreea.lupu\AppDa…, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, platformVersion: 10.0, proxy: Proxy(direct), rotatable: false, setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}

    _Session ID: f47ccab9-72c4-4bd2-a49b-22b2c6626cf0)

    _

    On Chrome,I don’t have this problem.

    This thing happens when you actually have web elemenets on the page with similar or close to similar attributes.
    Just make sure you pick the right one by assuring it with xpath expression.

    1 Like

    This worked for me. Thank you! :slight_smile:

    This worked for me too! Tks!! :+1::ok_hand:

    I have the same issue :disappointed_relieved:

    I have tried adding both a Scroll to Element and a Delay (4 sec), and on Bamboo using Firefox, I still get “Caused by: org.openqa.selenium.ElementNotInteractableException: Element could not be scrolled into view”. When I run the test locally, it works fine. Any other solutions?

    @mafisher

    Try to use WebUI.takeScreenshot after the you scroll to see if the element is actually visible in the execution.