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.

3

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;

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");

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.