Hi, I am trying to select item from dropdown. but I am unable to select . Please suggest me which tag I will use for select dropdown element.
-
Great, You have id in HTML. Would be easy. Give a try - I have answered on sqa.stackexchange.com/questions/21950/…– Narendra ChandratreCommented Oct 28, 2016 at 6:03
-
Drop down list open but does not select. have any solution ?– Imtiaz Ahmed BiplobCommented Oct 28, 2016 at 9:23
-
1Can you provide more information like the language being used for Selenium?– Paul MuirCommented Oct 28, 2016 at 11:19
Add a comment
|
2 Answers
The drop-down list is a select node with this id: operator_type
new Select(driver.findElement(By.id("operator_type"))).selectByVisibleText("your desired type");
you should import: import org.openqa.selenium.support.ui.Select;
You can use this code this POM design pattern..
@FindBy(id="status")
WebElement status_dropdown;
public void select_List(String status)
{
Select statusdropdown=new Select(status_dropdown);
statusdropdown.selectByVisibleText(status);
}
client.select_List("active");