Button is not clicked

Found this error during clicking on the button. Please find the detail

Test Cases/Booking Services for Customer FAILED because (of) Unable to click on object ‘Object Repository/Booking Services/a_next step’ (Root cause: org.openqa.selenium.ElementNotVisibleException: element not visible

(Session info: chrome=67.0.3396.99)

(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 0 milliseconds

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘WINCTRL-I1MBNJ3’, ip: ‘192.168.0.56’, os.name: ‘Windows 8.1’, os.arch: ‘amd64’, os.version: ‘6.3’, java.version: ‘1.8.0_102’

Driver info: com.kms.katalon.selenium.driver.CChromeDriver

Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.35.528161 (5b82f2d2aae0ca…, userDataDir: C:\Users\ASSET-~1\AppData\L…}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 67.0.3396.99, webStorageEnabled: true}

Session ID: 5b50e7c5c8174e13bcfdd66ef4d9eabc)

The error indicates the element not visible. I would check the object’s detection properties.

Hi Susan Thanks for your reply. I agree but when I add waitforelementvisible then this is also not working :frowning:

nazneen said:

Hi Susan Thanks for your reply. I agree but when I add waitforelementvisible then this is also not working :frowning:

But what is the error in that case?

hello,
my guess: since it’s Next button probably somewhere on bottom of screen i would check if you don’t need scroll to it WebUI.scrollToElement(element, timeout)

You can change the object repository and only checklist the possibility for the script. example only check the tag and text name. Probably the xpath is too complicated, so skipped other lists.

Image 85.png

Yes. But when I add wait for visible elements its still showing error. kindly guide me with some code.

nazneen said:

Yes. But when I add wait for visible elements its still showing error. kindly guide me with some code.

I’ll repeat my previous question: WHAT IS THE ERROR when you wait for the element to be visible?

Unable to click on object ‘Object Repository/Booking Services/a_next step’ (Root cause: org.openqa.selenium.ElementNotVisibleException: element not visible

(Session info: chrome=67.0.3396.99)

(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 0 milliseconds

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘WINCTRL-I1MBNJ3’, ip: ‘192.168.0.56’, os.name: ‘Windows 8.1’, os.arch: ‘amd64’, os.version: ‘6.3’, java.version: ‘1.8.0_102’

Driver info: com.kms.katalon.selenium.driver.CChromeDriver

Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.35.528161 (5b82f2d2aae0ca…, userDataDir: C:\Users\ASSET-~1\AppData\L…}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 67.0.3396.99, webStorageEnabled: true}

and my clode is:

WebUI.scrollToElement(findTestObject(‘Object Repository/Booking Services/input_billing_zip’), 15)

WebUI.waitForElementVisible(findTestObject(‘Object Repository/Booking Services/a_next step’), 5)

WebUI.click(findTestObject(‘Object Repository/Booking Services/a_next step’))

I have also used custom keywords coding but still tc failed

Nazneen, I am at the point of giving up on you, which is sad.

You have twice complained of not being able to click on the element and twice posted the error when you try the click.

You have twice stated you get an error when waiting for it to be visible and twice I have asked you for THAT error.

Now you post the error for the click. AGAIN.

Now, pay attention: WHAT IS THE ERROR WHEN YOU WAIT FOR THE ELEMENT TO BE VISIBLE?

Sorry for shouting but after three times asking, I think it’s justified.

Okay ! sorry I was focused on the error only. By the way for wait for visible element test cases passes.its only appear when I write click statement :frowning:

I apologize. You didn’t say the wait caused an error, you said it was “not working”.

Okay, let’s start over.

Post a screenshot of the page at the point where the click has happened and failed to work.

Oh sorry to make you confuse but I meant that wait for visible is working but click event is not working and here is the error :

Unable to click on object ‘Object Repository/Booking Services/a_next step’ (Root cause: org.openqa.selenium.ElementNotVisibleException: element not visible

(Session info: chrome=67.0.3396.99)

(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 0 milliseconds

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘WINCTRL-I1MBNJ3’, ip: ‘192.168.0.56’, os.name: ‘Windows 8.1’, os.arch: ‘amd64’, os.version: ‘6.3’, java.version: ‘1.8.0_102’

Driver info: com.kms.katalon.selenium.driver.CChromeDriver

Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.35.528161 (5b82f2d2aae0ca…, userDataDir: C:\Users\ASSET-~1\AppData\L…}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 67.0.3396.99, webStorageEnabled: true}

and my clode is:

WebUI.scrollToElement(findTestObject(‘Object Repository/Booking Services/input_billing_zip’), 15)

WebUI.waitForElementVisible(findTestObject(‘Object Repository/Booking Services/a_next step’), 5)

WebUI.click(findTestObject(‘Object Repository/Booking Services/a_next step’))

May be I am repenting the thing again and again but my main concern is the next button is not working. earlier the wait for visible was not working then I add scrolltoelement then its working but still the click event is not working

Hi, something that you can try is “verify object visible.” it will return either true or false.

If it returns true, Before you press the button click, Add in “focus” and choose the button.

Sometimes a 1 second delay before pressing the button can work as well.

Hi Andrew can you write in a script.

nazneen said:

Hi Andrew can you write in a script.

I am not a programmer, I have 0 scripting knowledge.

Just use the add buttons that Katalon has, and change the settings on the input tab.

Andrew, just some advice:

Open one of your test cases. Make sure you are fully familiar with the test case. Open the Script view tab. Study it. Try to understand how the real script is turned into what you see in Manual View.

Repeat. Every day.

Now, like me, you’re a novice programmer. Welcome.

I have been programming for 35+ years. Still learning! :smiley:

Nobody is born a programmer B)

1 Like

Andrej Podhajský said:

hello,
my guess: since it’s Next button probably somewhere on bottom of screen i would check if you don’t need scroll to it WebUI.scrollToElement(element, timeout)

If I ignore to scroll to element then button not appears to visible.