Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to select value from a drop down using Selenium IDE

I am using Selenium IDE for the first and has no knowledge of automation scripting. So far i am able to manage using IDE but one issue is I am not able to select a value from drop down list randomly rather entering the index or label values manually every time.

Can anyone please help me with this.

Thank You

like image 353
Anil Avatar asked Jun 26 '12 18:06

Anil


2 Answers

I tried the below and it worked

Command: Select

Target : element Locator eg : id = card

Value : index=1

like image 196
Simpu Avatar answered Sep 27 '22 19:09

Simpu


Use command select(selectLocator, optionLocator), 'selectLocator' is the Id of the drop down from which the value is being selected and the 'optionLocator' is the value being selected.

For eg: say a drop down having Id="//select[@id='type'" with values like 'TypeA, TypeB, TypeC,...'. If you are selecting 'TypeA' from the drop down, your command should go like this:

selenium.select("//select[@id='type']", "label=TypeA");

I hope this will solve your problem.

like image 21
Ranadheer Reddy Avatar answered Sep 27 '22 19:09

Ranadheer Reddy