Handling Drop down:
IwebElement
dropdown = driver.FindElement(By.Id(“xxx”));
SelectElement
s = new SelectElement(dropdown);
s.SelectByText(“India”);
Here we are
store main dropdown web element in a variable (dropdown), and then we create a
object for SelectElement class. By
using SelectByText method we select
the particular option in dropdown.
We can also
Select Option by using SelectByValue,
SelectByIndex
No comments:
Post a Comment