Step1: Create a Web-element and assign the path of Drop-down element to the Web-element.
Step2: Create a Select object and assign a Web-element object to the Select object created.
Step3: Select the value from the Dropdown element.
We have three types of method available to select option from Dropdown list
Select by Index
Select by value
Select by Visible Text
WebElement Dropdownelementtest = driver.findelement(by.-----());
Step2: Create a Select object and assign a Web-element object to the Select object created.
Select Dropdownoptiontest = new Select(Dropdownelementtest);
Step3: Select the value from the Dropdown element.
We have three types of method available to select option from Dropdown list
Select by Index
Dropdownoptiontest.selectByIndex(" ");
Select by value
Dropdownoptiontest.selectByValue(" ");
Select by Visible Text
Dropdownoptiontest.selectByVisibleText(" ");
No comments:
Post a Comment