Handling ListBoxes in selenium

ListBox is an element where user can select/deselect one or more items from it.

To identify the ListBox on webpage, look for select tag and attribute should be ‘multiple’ to select multiple items and there will be option tag which contains each item in it.[as shown below]

How can we identify a ListBox on webpage:

Now let’s get all the options from the ListBox

allvals is having list of all the ListBox items in it.

Let’s see some of the operations with ListBox


Content posted is based on learning or working experience,
Share the post with others if find useful,
Any queries?, leave comments or discuss on our facebook:qavalidation.com, Thanks!

Leave a Reply

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