Forum Discussion

coffee's avatar
coffee
Contributor
9 years ago
Solved

Select method (JS) to select something from drop-down list

Hi,

 

In Selenium Java, we can have this code here to select something from drop-down list :

 

Select s = new Select(driver.findElement(By.xpath("//path_to_drop_down")));
s.selectByVisibleText("Value1");
s.selectByIndex(5);

Just wondering, if we have some similar thing in TC using JavaScript to select something from drop-down list ?

 

Thank You.