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:

The following part of this document is poorly written:

What is Drop-down

This tutorial illustrates how to handle the drop-down list using Katalon Studio built-in keywords.
The below image shows what the sample select command has.

  1. Index: The index of the option to be selected/deselected.
  2. Value: Thevalue of the “value” attribute.
  3. Label: The exactly displayed text of a particular option

Then, which keyword a user should use? The document should explicitly nominate the names of keywords, and provide links to the document. For example:


  1. Index: The index of the option to be selected/deselected. You should use WebUI.selectOptionByIndex()
  2. Value: The value of the “value” attribute. You should use WebUI.selectOptionByValue
  3. Label: The exactly displayed text of a particular option. You should use WebUI.selectOptionByLabel

Can you please let me know how to wait until all values to populate in a dropdown

I don’t know.
As it depends on how each web page is designed/implemented.