Katalon passes click but nothing happens

Hi community,

I have a question which I can’t find the answer for.
I tell Katalon to click on an Object (button) and Katalon passes it, however in the browser nothing actually happens.

This is quite a straight forward Object.
image
I use attributes for my Objects.
I have tried; text = Studievoortgangsoverzicht
I have tried; title = studievoortgangsoverzicht
I have tried; tag = span / text = studievoortgangsoverzicht
I have tried; tag = button / title = studievoortgangsoverzicht
I even tried these with the class added to it as well, but nothing happens.

I tried to look in the code on a wider range and saw the ion-row and osi-button. (Not knowing what it was I looked around for it on google and the forums here).
I found out this is mostly used for apps. Now I know this website was build for mobile and browsers.
But I have a feeling that this is obstructing Katalon its click on the button. (Which I find weird because on the same website Katalon already did 2 clicks before coming to this part of the page with this specific button).

Is there anyone that could help me with this? Is there an import I need to do so Katalon can actually click on the button instead of just “passing” it? Or is there another solution to this? I am actually stuck on this case and the sad part is, this is only the start.

Regards,
Paulo

Could we see the relevant lines of code please? Need more detail to look at this

And don’t be discouraged, you will only improve from here :slight_smile:

Thanks for the reply.

The code of the button is in the picture.
What part are you specifically looking for? Or you want me to paste the html of the whole page?

I meant your code in Katalon (script)

You are right, forgot that one.

The script I have is just the 1 line at the moment with the default imports.
WebUI.click(findTestObject(‘Page_Home (Student)/Voortgang/click_Studievoortgangsoverzicht’))

Attribute properties are;


I’ve tried different things in the properties but all with the same results.

You need to add some preliminary steps before this step. At the moment you’re going right in and clicking the object

  1. You need to open the browser
  2. You need to add a ‘WaitForElementPresent’ or ‘WaitForElementClickable’ and wait on that same object you’re clicking on
  3. Then you can add a click on the object
  4. Then add verification steps after that

Hopefully that helps

Ah, there is a slight miscommunication. My bad here.
I always break up my scripts in modules where a testcase is a module and a test suite is a testcase. (With this structure it is easier and faster to modify changes on the page into my scripts).

Basically I have 2 other modules, 1 where it opens the browser and goes to the website and the other module goes to a specific page.
Then the 3rd module is where I am stuck.

I will put these modules into 1 script in here so you can see what I have (I also already tried the wait for element but it didn’t work).

My whole script is the following;
WebUI.openBrowser(’’)
WebUI.navigateToUrl(‘https://www.website.com’)
WebUI.maximizeWindow()
WebUI.click(findTestObject(‘Page_Home (Student)/click_Voortgang’))
WebUI.delay(5)
WebUI.verifyElementPresent(findTestObject(‘Page_Home (Student)/Voortgang/click_Dossieroverzicht’), 10)
WebUI.click(findTestObject(‘Page_Home (Student)/Voortgang/click_Studievoortgangsoverzicht’))

I just added
WebUI.waitForElementPresent(findTestObject(‘Page_Home (Student)/Voortgang/click_Studievoortgangsoverzicht’), 10)
before the click. And it gives the same behaviour. Katalon passes it but no button was clicked on the page.

Ah right okay. Could I see the xpath or locator you used for the object you’re clicking?

This is what I use. I preferably avoid XPath tho. Due to if there is a change on the page, the XPath will likely have to be updated as well.

I wonder if you used lower-case ‘s’ in the above for the title? - if so try changing to upper case S?

Another thing, could try double quotes rather than single quotes?

Text might not be the most reliable way to identify it on the page, class would be better. In this case, you’ve written ‘. = Studievoortgangsoverzicht’ when it looks like the class in your POM is “button-inner”

Hard to say without going in and checking myself but these are just some things to try maybe?

I used uppercase (I copy / paste directly from the code).
But I am going to try a few things.

Double quotes: Click passes but nothing happens in the browser.
Lowcase text / title: Click fails in Katalon (So the text has to be exact).
Class only: Click passes but nothing happens in the browser.
I also tried tag = button / tag = span with class combination and the click passes but nothing happens in the browser.
Changing text / title from EQUAL to CONTAINS also didn’t change the results.

Hmm. Only other thing I can think of is whether the object you’re trying to locate might be inside an iFrame? In which case it might be stopped from clicking on it, but would still show the object as present on the page.

I’d also suggest maybe using ‘Double click’ instead of click to see if that works, or could try integrating into the script one of the default custom keywords that have been created and packaged with Katalon under Keywords --> custom --> general.groovy
There’s a function in there called ‘clickElement’ and some other useful ones.

Doesn’t seem like there is an iFrame on the page.
I will check with the double click and else I will check those custom Keywords.

I will keep you posted!

1 Like

Oke, so double click seems to give an error for some reason.
06-08-2020 02:48:35 PM Test Cases/Home (Student)/Voortgang/Go to Studievoortgangsoverzicht

Elapsed time: 3.189s

Test Cases/Home (Student)/Voortgang/Go to Studievoortgangsoverzicht FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to double click on object ‘Object Repository/Page_Home (Student)/Voortgang/click_Studievoortgangsoverzicht’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.DoubleClickKeyword.doubleClick(DoubleClickKeyword.groovy:87)
at com.kms.katalon.core.webui.keyword.builtin.DoubleClickKeyword.execute(DoubleClickKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:72)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.doubleClick(WebUiBuiltInKeywords.groovy:697)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$doubleClick.call(Unknown Source)
at Go to Studievoortgangsoverzicht.run(Go to Studievoortgangsoverzicht:25)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.RawTestScriptExecutor.runScript(RawTestScriptExecutor.java:34)
at com.kms.katalon.core.main.RawTestScriptExecutor.doExecute(RawTestScriptExecutor.java:29)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCaseRawScript(TestCaseMain.java:151)
at com.kms.katalon.core.main.TestCaseMain$runTestCaseRawScript$0.call(Unknown Source)
at TempTestCase1591620512811.run(TempTestCase1591620512811.groovy:50)
Caused by: org.openqa.selenium.WebDriverException: TypeError: rect is undefined
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘HHS-LAP51666’, ip: ‘192.168.0.114’, 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.ExistingRemoteWebDriver
Capabilities {javascriptEnabled: true, platform: ANY, platformName: ANY}
Session ID: cb66e7fa-0ebb-44fd-a20c-685b63b5a055
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at com.kms.katalon.core.webui.driver.ExistingRemoteWebDriver.execute(ExistingRemoteWebDriver.java:108)
at org.openqa.selenium.remote.RemoteWebDriver.perform(RemoteWebDriver.java:618)
at org.openqa.selenium.support.events.EventFiringWebDriver.lambda$new$1(EventFiringWebDriver.java:105)
at com.sun.proxy.$Proxy9.perform(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver.perform(EventFiringWebDriver.java:360)
at org.openqa.selenium.interactions.Actions$BuiltAction.perform(Actions.java:639)
at com.kms.katalon.core.webui.keyword.builtin.DoubleClickKeyword$_doubleClick_closure1.doCall(DoubleClickKeyword.groovy:80)
at com.kms.katalon.core.webui.keyword.builtin.DoubleClickKeyword$_doubleClick_closure1.call(DoubleClickKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
… 16 more

I also checked the custom keywords but nothing that can solve it sadly.

Hmm, okay. I’m thinking it’s something to do with the object. Is it possible to test out using different types of locators just to make sure it’s the locator and not something on the page? e.g. xpath
//span[@class=“button-inner”] or //span[text()=“Studievoortgangsoverzicht”]

And are you searching your locators in the Chrome dev tools DOM area before writing them in Katalon?

Looks like XPath gives an error.

06-09-2020 07:32:09 AM Test Cases/Home (Student)/Voortgang/Go to Studievoortgangsoverzicht

Elapsed time: 47.118s

Test Cases/Home (Student)/Voortgang/Go to Studievoortgangsoverzicht FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to double click on object ‘Object Repository/Page_Home (Student)/Voortgang/click_Studievoortgangsoverzicht’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.DoubleClickKeyword.doubleClick(DoubleClickKeyword.groovy:87)
at com.kms.katalon.core.webui.keyword.builtin.DoubleClickKeyword.execute(DoubleClickKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:72)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.doubleClick(WebUiBuiltInKeywords.groovy:697)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$doubleClick.call(Unknown Source)
at Go to Studievoortgangsoverzicht.run(Go to Studievoortgangsoverzicht:25)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.RawTestScriptExecutor.runScript(RawTestScriptExecutor.java:34)
at com.kms.katalon.core.main.RawTestScriptExecutor.doExecute(RawTestScriptExecutor.java:29)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCaseRawScript(TestCaseMain.java:151)
at com.kms.katalon.core.main.TestCaseMain$runTestCaseRawScript$0.call(Unknown Source)
at TempTestCase1591680727127.run(TempTestCase1591680727127.groovy:50)
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Page_Home (Student)/Voortgang/click_Studievoortgangsoverzicht’ located by ‘By.xpath: //span[@class=“button-inner”]’ not found
at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1154)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:27)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.DoubleClickKeyword$_doubleClick_closure1.doCall(DoubleClickKeyword.groovy:77)
at com.kms.katalon.core.webui.keyword.builtin.DoubleClickKeyword$_doubleClick_closure1.call(DoubleClickKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
… 16 more

They both give the same error.

Were you ever able to get any resolution on this? I’m getting a very similar issue.

If you are getting a similar issue, then you have a concern with “finding” your object. For us to assist you with that, we would need more information such as the HTML and anything else that could help us to assist you.

@paulo.resende @leyla.hunn @grylion54
I’m also facing same issue. Click passed but action not performed……mine button click is on overlay and this happening only in headless mode but in chrome it works…u got solution for this issue

It’s possible that you have the wrong element, or its pathway to the element. Can you show us the HTML so we can better guide you?