Not able to execute my web recorded Test Case in Katalon

I have recorded my test case for my web app in katalon . After that i tried execute i am facing below error

12-10-2019 09:35:12 AM click(findTestObject(“Object Repository/TestObject1/Page_SEF/div_No issues”))

Elapsed time: 46.878s

Unable to click on object ‘Object Repository/TestObject1/Page_SEF/div_No issues’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/TestObject1/Page_SEF/div_No issues’
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.ClickKeyword.click(ClickKeyword.groovy:103)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:43)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$3.call(Unknown Source)
at TestCase1.run(TestCase1:57)
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.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
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.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1575950667892.run(TempTestCase1575950667892.groovy:23)
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/TestObject1/Page_SEF/div_No issues’ located by ‘By.xpath: //span[@id=‘LiverpoolTheme_wt221_block_wtMainContent_wt152_SEACommon_wt1_block_wtSectionListRecords_ctl00_wt9_wtQuestionSections_ctl00_wt4_wt5_wtQuestionsList_ctl00_wt18_wtListRecords1’]/div/div’ not found
at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1113)
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.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:68)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.call(ClickKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:103)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:43)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$3.call(Unknown Source)
at Script1575950403894.run(Script1575950403894.groovy:57)
… 11 more
)

Hello,
unfortunately even after lot of effort from Katalon devs side xpaths generated from recored are not the best ones as you can see in your error:

xpath generated is :
//span[@id=‘LiverpoolTheme_wt221_block_wtMainContent_wt152_SEACommon_wt1_block_wtSectionListRecords_ctl00_wt9_wtQuestionSections_ctl00_wt4_wt5_wtQuestionsList_ctl00_wt18_wtListRecords1’]/div/div
this id seems to me like something that was generated by application, thus can change from execution to execution…
try to use really unique xpath or css to point Katalon to your element.

perhaps is the time for you to reconsider your approach and try different locators? e.g CSS selectors?
the xpath locators are only a ‘best guess’. different recording tools may find different ones.

and yeah … giving more details regarding the app you attempt to test (like full html code and the element you try to reach highlited) will help other people to help you better.

just saying …

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.