0

Can anyone help me on this.. I am new selenium and dont know how to select the value from a window with the drop down value.

Pls help me how to write the below value in selenium.

Orientation

Thanks in advance..

2

You can select a value from a dropdown using Select class with selectByvalue or SelectByVisibleText or SelectByIndex depending upon your need. The following code is used for selecting a value from a dropdown.

WebElement element = driver.findElementById("specify your locator value");    
Select dropdown = new Select(element);    
dropdown.SelectByVisibleText("Your text value");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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