Showing posts with label Select commands. Show all posts
Showing posts with label Select commands. Show all posts

Working with the multiple windows in selenium IDE is not hard. Many selenium IDE users asking me for this question so let me try to explain it. You need to handle multiple windows many time of software applications regression testing using selenium IDE or any other tools. As you all knows, selenium IDE is not too much


"verifySelectOptions", "verifySelectedLabel" and "verifySelectedIndex" commands works with drop down list box or multi select list box. Let me explain all of three first and then will see them with example.

Selenium IDE "verifySelectOptions" Command
"verifySelectOptions" command used for verification of list box option values. It will show error message if

Pending commands list in part 1 with tutorial link are listed in bellow given table. Click on command link to view selenium IDE software testing tool's command example. I tried my best to cover all commands of selenium IDE software testing tool. You can suggest me if any command is pending to list in these tables by commenting bellow this post.

Selenium IDE commands with examples
There are many commands available in selenium IDE software testing tool. I have prepared one selenium commands list and linked some selenium ide command with its examples. So you can click on command link(From bellow given selenium ide commands list table) to view how to and where to use that command with example. This full selenium command list will help you to learn selenium IDE software testing tool on beginning level.

(Do you wants to be master of selenium IDE software testing tool in just 7 days? If yes then Read this Selenium IDE tutorials)

Pending command's(Which are not linked) example creation is in process. you can subscribe via email for

Selenium IDE is very useful regression testing tool in software industry. Selenium IDE has many built in commands and you can also extend it using extensions files. Let me describe you more 2 commands of Selenium IDE.

"selectPopUpAndWait" command
You can read my post about "selectPopUp" command before understanding "selectPopUpAndWait" command. As name suggests, "selectPopUpAndWait" is combination of two commands - 1) "selectPopUp" and 2) "waitForPageToLoad". "selectPopUp" command will select targeted popup window and

"selectPopUp" command
"selectPopUp" command works same as "selectWindow" command. Sometimes when you click on link then it is opening new window popup. If you want to perform some actions on new opened popup window then you need to select that popup first then and then you can perform any action on new window. In such

"selectframe" Command in selenium 

You need to use "selectframe" command in selenium when your page contains iframe anf you have to perform some action on element inside iframe. You need to provide name or id attribute of iframe element into target column. Here is the simple example of iframe.


"verifySomethingSelected" commands

"verifySomethingSelected" is used with drop downs and list boxes. Its name describes its function so that i think i do not need to describe it more. It is used to verify that is there any label is selected in drop down or not. It will becomes pass if any one label is selected. Else it will return "false" in log. Run bellow example with

"waitForPopUp" Command

Remember one thing that selenium IDE software automation testing tool can handle only one window at a time. When you are taking some action like clicking on link or button and open new popup window then how to handle it in selenium IDE software automation tool? "selectWindow" command will help you to select window but before that you need to verify that your expected window is open or not. "waitForPopUp" command will help you to wait until your expected window is not open. 

You can give JavaScript window "name" of the window in to target of "waitForPopUp" command. If you leave target blank or "null" then "waitForPopUp" will wait for the first non-top window to appear. Put

 "addSelectionAndWait" command in selenium IDE

When you are adding selection into multi select list box and page reloading due to the adding selection, you need to use addSelectionAndWait command to handle page loading event. You can use addSelection if page not reloading after adding selection.

I have not any perfect example of page reloading when adding selection in list box. Let me try to show you how to use addSelectionAndWait command.


New Test
CommandTargetValue
openhttp://only-testing-blog.blogspot.com/2013/09/testing.html
addSelectionname=FromLBlabel=Japan
addSelectionname=FromLBlabel=India
addSelectionAndWait name=FromLBlabel=Mexico

In this example, when selection label=Mexico, page not reloading so that this command will be not helpful

"addSelection" Command

In multiselect list box, when you need to select multiple values from list box, "addSelection" command will be helpful in selenium IDE. "Select" command will select only single value from list box but "addSelection" command will add new value selection in list box means previously selected values will remain selected as it is and will add new selection.

Run bellow given example yourself to understand it better. In this example, first i am adding value "Japan" from list box using "addSelection" command and next 3 commands will select 3 new values using "addSelection" command.

New Test
CommandTargetValue
openhttp://only-testing-blog.blogspot.com/2013/09/testing.html
addSelectionname=FromLBlabel=Japan
addSelectionname=FromLBlabel=Mexico
addSelectionname=FromLBlabel=India
addSelectionname=FromLBlabel=Spain

VIEW PRACTICAL EXAMPLE IN SELENIUM WEBDRIVER OF addSelection COMMAND

"removeSelection" Command

"removeSelection" command works in opposite of "addSelection" command. It will remove selection of

"storeSelectOptions" Command

We can use "storeSelectOptions" command with only list box and drop downs. Function of this command is it will store all option labels names of targeted drop down or targeted list box in to variable. See bellow given example.


New Test
Command Target Value
storeSelectOptions ctrl55_Contentitem_State label
storeValue chk_box_01value

In above example, "storeSelectOptions" command will store all option labels names of targeted list box

"storeSelectedLabel" Command

We can use "storeSelectedLabel" Command only with drop down and list box. When you want to know or you need to compare selected option value of drop down with some other value at that time first you need to store value of selected label. In such condition you can use "storeSelectedLabel" Command. Let we see with example.

New Test
Command Target Value
storeSelectedLabel ctrl55_Contentitem_State value
storeSelectedLabels ctrl55_Contentitem_Statevalues


In above example, First command "storeSelectedLabel" will store selected label name of drop down(ctrl55_Contentitem_State) into variable "value". Here "ctrl55_Contentitem_State" is the name of drop

"storeSelectedIndex" Command

storeSelectedIndex works with only select or multi-select target element like drop down and list box. Using this command, you can get option index of selected option.


New Test
CommandTargetValue
storeSelectedIndexctrl5_Main_ddlStateindexno
echo${indexno}
storeSelectedIndexesctrl5_Main_ddlStateindexnos
echo${indexnos}

(Note : Click here to view examples of other store commands.)

In above example, ctrl5_Main_ddlState target element is list box.Here command "storeSelectedIndex" will store index value of current selected option of target element ctrl5_Main_ddlState list box into variable "indexno". We can also use this command with any drop down. We can use "storeSelectedIndex " if there is

"select" Command

Purpose of "select" command is to select label from drop down/combo box or list box.

New Test
Command Target Value
open http://only-testing-blog.blogspot.com/2014/01/textbox.html
select name=FromLB Russia

View example of HOW TO SELECT VALUE FROM DROP DOWN IN WEBDRIVER.

In this example, You need to add combo box id/Name/Xpath into target column and need to add option's value or visible text or index into value column. Supposing if your option name is "Russia" then you need to add it as Russia.