Answers for "selenium get dropdown text"

0

selenium get dropdown text

Select select = new Select(driver.findElement(By.xpath("//select")));
WebElement option = select.getFirstSelectedOption();
String defaultItem = option.getText();
System.out.println(defaultItem );
Posted by: Guest on May-20-2021

Browse Popular Code Answers by Language