"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
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
specified value from multiselect list box.

In bellow given example, "removeSelection" command will remove selection of label "India" from list box.

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
removeSelectionname=FromLBlabel=India

2 comments:

  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!! :)

    ReplyDelete
  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!!

    ReplyDelete