0

enter image description here

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
3
  • Great, You have id in HTML. Would be easy. Give a try - I have answered on sqa.stackexchange.com/questions/21950/… Commented Oct 28, 2016 at 6:03
  • Drop down list open but does not select. have any solution ? Commented Oct 28, 2016 at 9:23
  • 1
    Can you provide more information like the language being used for Selenium? Commented Oct 28, 2016 at 11:19

2 Answers 2

3

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;

answered Oct 28, 2016 at 11:15
0
0

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.