Submenu option is not working - WebUI - Need help

Hello Team,

I am trying Katalon WebUI, the option menu and submenu is not working for me. Tried many methods using katalon forum but none helped me. Could you please solve this? The error message says as below:
=============== ROOT CAUSE =====================
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Custom OR/Imam Site Selection/Site_01’ located by '//[(text() = ‘01’ or . = ‘01’)]’ not found*

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html
================================================

11-15-2021 01:00:48 PM click(findTestObject(“Custom OR/Imam Site Selection/Site_01”))

Elapsed time: 45.961s

Unable to click on object ‘Object Repository/Custom OR/Imam Site Selection/Site_01’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object 'Object Repository/Custom OR/Imam Site Selection/Site_01’
*** 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:75)***
*** at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:42)***
*** at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)***
*** at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:620)***
*** at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$3.call(Unknown Source)***
*** at 1 Screening.run(1 Screening:37)***
*** 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:430)***
*** at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:421)***
*** at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:400)***
*** at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:392)***
*** at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:273)***
*** at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)***
*** at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)***
*** at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)***
*** at TempTestCase1636961358381.run(TempTestCase1636961358381.groovy:25)***
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Custom OR/Imam Site Selection/Site_01’ located by '//[(text() = ‘01’ or . = ‘01’)]’ not found*
*** at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1368)***
*** 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:66)***
*** 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:75)***
*** at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:42)***
*** at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)***
*** at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:620)***
*** at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$3.call(Unknown Source)***
*** at Script1636363633524.run(Script1636363633524.groovy:37)***
*** … 11 more***
)

Here is the script which I am trying to run:

CustomKeywords.‘newpackage.LoginHelper.loginIntoApplication’(‘URL/PORTAL/’, Username, Password)
WebUI.waitForPageLoad(0)
WebUI.click(findTestObject(‘1 Imam ARU 57700002 - Custom OR/switch to protocol/Switch to - Button’), FailureHandling.STOP_ON_FAILURE)
WebUI.click(findTestObject(‘Custom OR/switch to protocol/SwitchTo_Protocol_XYZ’))
WebUI.mouseOver(findTestObject(‘Switch to Protocol/User role - Subj Mgt - XYZ Investigator’), FailureHandling.STOP_ON_FAILURE)
WebUI.click(findTestObject(‘Switch to Protocol/User role - Subj Mgt - XYZ Investigator’), FailureHandling.STOP_ON_FAILURE)
WebUI.waitForPageLoad(0)

The page loads till “SwitchTo_Protocol_XYZ”.

from what i can tell, your locator is “//[(text() = ‘01’ or . = ‘01’)]”, which is not valid xpath, the locator should be “//*[(text() = ‘01’ or . = ‘01’)]”, with a * after the // to indicate it can match any element with text ‘01’

And I would reset the 0 in the above statement to 10. The page loading does take some time, not 10 seconds, but obviously more than instantaneously.

thank you but the issue is not that.

thank you but the process stops at the drop down where the text 01 is not applied. my issue was the submenu under a menu… it is not chosen properly. Also, the XPath is not matching, the list gets updated anytime.