How to handle Drop-down menu


This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/docs/how_handle_drop_down_menu.html

I want to handle drop-down selection with value on Mobile side can you please suggest me how to do that ?

Needs a way to get the value (label) of the currently selected option(s).

@bdudek First off, are you asking for Mobile or Web? Second, if Web, is the element a select tag? If a select tag, you can get either value, label or even index (if your page has such).

WebUI.selectOptionByValue(findTestObject(...), "valueRef", false)

or

WebUI.selectOptionByLabel(findTestObject(...), "Label", false)

Since your element has “currently selected option”, you can verify that with:

WebUI.verifyOptionSelectedByValue(findTestObject(...), "valueRef", false, 10)

or

WebUI.verifyOptionSelectedByLabel(findTestObject(...), "Label", false, 10)

I was looking for web. Thanks! :slight_smile: