InterviewSolution
Saved Bookmarks
| 1. |
How to handle a dropdown in Selenium WebDriver? How to select a value from the dropdown? |
|
Answer» Questions on the dropdown and selecting a value from the dropdown are common Selenium interview questions. You should know that to work with a dropdown in Selenium, always make use of HTML tag: ‘select’. Without using ‘select’, you cannot handle dropdowns. So the STEPS to select an element from the drop-down are -
To identify the ‘select’ html element from the web page, use findElement() method. Look at the below piece of code:
Now to select an option from that dropdown can be done in THREE WAYS:
These are the different ways to select a value from a dropdown. |
|