We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

Category: Java

How to select a value from a dropdown ?

We can select a value from a dropdown by using WebDriver’s Select class. Syntax: < View plain text > java selectByValue: Select selectByValue = new Select(driver.findElement(“SelectID_One”))); selectByValue.selectByValue(“greenvalue”);   selectByVisibleText: Select selectByVisibleText = new Select (driver.findElement(“SelectID_Two”))); selectByVisibleText.selectByVisibleText(“Lime”);   selectByIndex: Select selectByIndex = new Select(driver.findElement(“SelectID_Three”))); selectByIndex.selectByIndex(2); < View plain text > java public Select(WebElement element) A check […]

Page 2 of 41234 © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!