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.
asked Oct 28, 2016 at 5:46
-
Great, You have id in HTML. Would be easy. Give a try - I have answered on sqa.stackexchange.com/questions/21950/…Narendra Chandratre– Narendra Chandratre2016年10月28日 06:03:30 +00:00Commented Oct 28, 2016 at 6:03
-
Drop down list open but does not select. have any solution ?Imtiaz Ahmed Biplob– Imtiaz Ahmed Biplob2016年10月28日 09:23:27 +00:00Commented Oct 28, 2016 at 9:23
-
1Can you provide more information like the language being used for Selenium?Paul Muir– Paul Muir2016年10月28日 11:19:21 +00:00Commented Oct 28, 2016 at 11:19
2 Answers 2
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");
answered Oct 28, 2016 at 12:15
user21268user21268