Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

1 like 0 dislike
179 views
by The go-to Tester (344 points)
How to select multiple options from a combo box in selenium using Java?

1 Answer

1 like 0 dislike
by The go-to Tester (473 points)
selected by
 
Best answer
1) find the main element in which option are present and then save it as type  webelement

 Ex. main=driver.findElement(By.className("area"));

2) now find and save list of option present under above saved main element and save these options as type LIST<webelement>

Ex. List<WebElement> list=main.findElements(By.tagName("options"));

3) Now select the option using index number

 Ex. list.get(1);

        list.get(2); etc


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...