Dropdown Elements not clicking

Good Afternoon,

I am wanting to click a button from a dropdown tab. I have the Recording of me clicking 2 different IDs, but neither of them actually click the button. Any help would be appreciated. I will post my script and error at the bottom.

//DropDown Menu
WebUI.click(findTestObject('Object Repository/Emp/Page/DropdownMenu'))

//Support Button 1
WebUI.click(findTestObject('Object Repository/Emp/Page/div_Support'))

//Support Button 2
//not_run: WebUI.click(findTestObject('Object Repository/Emp/Page/span_Support'))

Error
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to verify object is present
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.VerifyElementPresentKeyword.verifyElementPresent(VerifyElementPresentKeyword.groovy:92)

One of those test Objects is not found in the DOM.

Check the definition of the objects (check the XPath).

Make sure you are waiting long enough for the browser to display the elements.

Hii Vellj,

Try this approach…

Hope that helps. . . :slight_smile:

Hello @Arnel I am following your steps but I have a question.

Questions:
-Sample 1:

  1. How do I get to that “Selected Locator” tab? I opened the WebRecorder, and was about to add a item however Im not sure what Keyword I used in the items category. Can you shed more light around that area?

Answer: Nevermind I found the Object Repo box

NewQuestion
2. I am trying to keep up with your instructions but now i am at a new halt. You used the attribute section, but you copied a class. And I got the dropdown class information, but I got a error message. I will post my script and code at the bottom.

//Verify that Request off is the main widget on the screen
//WebUI.verifyElementPresent(findTestObject('Page/InsideRequestBox'), 5)
WebUI.delay(5)
//Nofitication Bar
//not_run: WebUI.verifyElementNotVisible(findTestObject('Object Repository/Employee001/Page/NotficationBar'))
//WebUI.delay(5)

//DropDown Menu
WebUI.click(findTestObject('Object Repository/Employee001/Page/DropdownMenu'))
WebUI.delay(5)

//Inspect the dropdown menu
java.util.List<WebElement> list = WebUiCommonHelper.findTestObject('Object Repository/Employee001/Page/DropdownListReadOut')
println list.text
list[1].click()

Error
08-12-2019 11:44:57 AM Test Cases/Employee/EmployeeOne

Elapsed time: 28.080s

Test Cases/Employee/EmployeeOne FAILED.
Reason:
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.common.WebUiCommonHelper.findTestObject() is applicable for argument types: (java.lang.String) values: [Object Repository/Employee001/Page/DropdownListReadOut]
	at EmployeeOne.run(EmployeeOne:56)
	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)

This is not a method in the WebUiCommonHelper class. Instead of this:

java.util.List<WebElement> list = WebUiCommonHelper.findTestObject('Object Repository/Employee001/Page/DropdownListReadOut')

try:

List<WebElement> list = WebUiCommonHelper.findWebElements(findTestObject('Employee001/Page/DropdownListReadOut'))