select (target, pattern), selectAndWait (target, pattern) - Selenium IDE command

The purpose of select and selectAndWait is to select a value from drop down/combo box or list box.

Option locators provide different ways of specifying a select element (e.g., label=, value=, id=, index=). If no option locator prefix is provided, a match on the label will be attempted. If you use label= you can also use asterisk * to match only parts of the string. For example instead of label=RPA software you can use label=*PA softwar*.

If your page is reloading when you select label from drop down then you need to use "selectAndWait" command. It will select the specified label and then it will wait for page to load successfully.

How to automate dynamic dropdown menus and select boxes

Standard HTML select boxes (like the one on our contact form) can be easily recorded and automated with the Selenium IDE-style Select command - just as is described on this page. But note that the Selenium IDE Select command fails often at “modern”, "ajax" select boxes that “do something while you type”, e. g. they present and then narrow down a selection based on the characters that to type. To automate such page elements you need to use XClick and XType. Please see this RPA forum post: How to automate interactive dropdown menus and select boxes.

select Example

The example macro below visits the online ocr form and selects several different OCR languages using the label=, label=*..*, value= and index= methods.

Command Target Pattern/Text
open https://ocr.space/
select id=ocrLanguage label=ChineseSimplified
select id=ocrLanguage label=*man*
select id=ocrLanguage value=ita
select id=ocrLanguage index=10
click id=SearchableAndLayer

Works in

UI.Vision RPA for Chrome Selenium IDE, UI.Vision RPA for Firefox Selenium IDE, Firefox IDE Classic

Related Demo Macros

DemoImplicitWaiting uses select

The ready-to-import-and-run source code of all demo macros can be found in the Open-Source RPA software Github repository.

See also

click, addSelection, removeSelection, Web Automation Extension User Manual, Selenium IDE commands, Classic Firefox Selenium IDE.

Select Boxes in desktop, Citrix, SAP and mobile apps automation

The Selenium IDE select command works only for standard select boxes. It does not work for select boxes in desktop apps. Also, some modern web apps might be have select box-style elements that look like a HTML select box, but technically is custom Javascript (Example). In all these cases you can use visual select box automation.

Anything wrong or missing on this page? Suggestions?

...then please contact us.

<em>UI.Vision RPA</em> Selenium IDE for Chrome and Firefox - Web Test Automation
Subscribe to the UI Vision RPA software newsletter . We'll send you updates on new releases that we're working on.