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.
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.
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’))
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.
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.
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?
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
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