You can select through 3 method:
1. SelectByVisibleText
2. selectByIndex
3. selectByValue
First identifie the drop down box
Select dropdown = new Select(driver.findElement(By.id("<>")));
To select its option say 'Programmer' you can do
dropdown.selectByVisibleText("Programmer ");
or
dropdown.selectByIndex(1);
or
dropdown.selectByValue("prog");
1. SelectByVisibleText
2. selectByIndex
3. selectByValue
First identifie the drop down box
Select dropdown = new Select(driver.findElement(By.id("<>")));
To select its option say 'Programmer' you can do
dropdown.selectByVisibleText("Programmer ");
or
dropdown.selectByIndex(1);
or
dropdown.selectByValue("prog");
No comments:
Post a Comment