“addSelection” and “removeSelection” command example in selenium IDE

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
Command Target Value
open http://only-testing-blog.blogspot.com/2013/09/testing.html
addSelection name=FromLB label=Japan
addSelection name=FromLB label=Mexico
addSelection name=FromLB label=India
addSelection name=FromLB label=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
specified value from multiselect list box.
In bellow given example, “removeSelection” command will remove selection of label “India” from list box.
New Test
Command Target Value
open http://only-testing-blog.blogspot.com/2013/09/testing.html
addSelection name=FromLB label=Japan
addSelection name=FromLB label=Mexico
addSelection name=FromLB label=India
addSelection name=FromLB label=Spain
removeSelection name=FromLB label=India

2 thoughts on ““addSelection” and “removeSelection” command example in selenium IDE

  1. Awesome blog.
    Sincere thanks to the developer of this blog. It is very explanatory at a basic level. Shows the dedicated hard work and dedication of the developer. Keep the nice work going up.

    Cheers!! 🙂

  2. Great work.

    Sincere thanks to the developer of this blog. Selenium commands are explained in a very informative and basic level. Sincerely the hard-work and dedication of the developer. Keep the nice work going up.

    Cheers!!

Leave a Reply

Your email address will not be published. Required fields are marked *