How do you execute a web element that cannot be found?

Hello everyone,
I am currently trying to create an automatic test case.
Does anyone know how to execute the Execute element in Sap Charm WebUI 5?

Environment: SAP Solution Manager Change Request Management → Create normal change.
The docuemnt is filled out during the scan it also recognises #C56_W158_V159_aciaction_table[3].thtmlb_oca but when I start the test case it does not find this field anymore.

Translated with DeepL.com (free version)

#C56_W158_V159_aciaction_table[3].thtmlb_oca

Unable to click on object ‘Object Repository/Charm-Test Dynamic/1manuell/new/Page_CC4 Normal Change/a_Execute’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/Charm-Test Dynamic/1manuell/new/Page_CC4 Normal Change/a_Execute’

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:74)

at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:40)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:659)

at test2.run(test2:81)

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:448)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:137)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:128)

at TempTestCase1715864510642.run(TempTestCase1715864510642.groovy:25)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Charm-Test Dynamic/1manuell/new/Page_CC4 Normal Change/a_Execute’ located by ‘//a[@id=‘C56_W170_V171_aciaction_table[3].thtmlb_oca’]’ not found

at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1426)

at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:27)

at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:65)

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:74)

at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:40)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:659)

at Script1715847717438.run(Script1715847717438.groovy:81)

… 13 more

)

Unable to click on object 'Object Repository/test2/Page_Charm/a_Execute434' (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object 'Object Repository/test2/Page_Charm/a_Execute434'
	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:74)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:40)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:659)
	at test2.run(test2:81)
	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:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:137)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:128)
	at TempTestCase1715864323629.run(TempTestCase1715864323629.groovy:25)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'Object Repository/test2/Page_Charm/a_Execute434' located by '//*[@id = 'C56_W158_V159_aciaction_table[3].thtmlb_oca' and @rel = 'noopener noreferrer' and @class = 'th-lk' and @href = 'javascript:void(0)' and @onclick = concat("htmlbSubmitLib(" , "'" , "THTMLB" , "'" , ",this," , "'" , "thtmlb:link:click:0::CL_THTMLB_TABLE_VIEW::EXECUTE.3" , "'" , "," , "'" , "myFormId" , "'" , "," , "'" , "C56_W158_V159_aciaction_table[3].thtmlb_oca" , "'" , "," , "'" , "_ONE_CLICK_ACTION" , "'" , ",0);return false") and @title = 'Execute' and @onfocus = 'thSaveKbFocus(this);' and @oncontextmenu = 'return false;' and (text() = 'Execute ' or . = 'Execute ')]' not found
	at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1426)
	at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:27)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:65)
	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:74)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:40)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:659)
	at Script1715847717438.run(Script1715847717438.groovy:81)
	... 13 more
)


best regards
Andre

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

Sometimes you need to “slow” things down when you run your test case because your script is going faster than your browser. For instance, when you move to a new page, you can add: WebUI.waitForPageLoad(10)

After this, I have been directly adding a “timeout” to ensure the page will have fewer issues:
WebUI.waitForElementVisible(findTestObject('...'), 10)

So, do you just record your test(s) or do you massage it with the addition of “wait” statements and “verify” statements? How about adding some waitForElementVisible and verifyElementVisible statements before your “click” and see if that helps with your error message?

Additionally, you need to review if you have the correct pathway to your object. Do you know if your attributes are static or dynamic?

Edit: In the case of your object, #C56_W158_V159_aciaction_table[3].thtmlb_oca, you should launch your application again and see if the object has the same <id> attribute. If it is different, then you will have to change your pathway to the object, maybe like:
//a[contains(@id, "_aciaction_table[3].thtmlb_oca")]

If the <id> attribute is the same, then try and “slow” your script down with "wait"s and "verify"s, as I stated above, and see if that works.

1 Like