Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

Select values from Dropdown in Selenium webdriver

Category: Selenium WebDriver

Selenium already provides Select class that has some predefined method which help is a lot while working with Dropdown.

WebElement month_dropdown=driver.findElement(By.id(“month”));
Select month=new Select(month_dropdown);
month.selectByIndex(4);
month.selectByValue(“5”);
month.selectByVisibleText("Aug");

Leave a Reply

Your email address will not be published. Required fields are marked *