[ Program & Execution] How to automate multi select drop down using selenium webdriver

preview_player
Показать описание
public class Test11

{

public static void main(String[] args) throws InterruptedException

{

//Launch the chrome browser

WebDriver driver= new ChromeDriver();

//Assign the website link to string variable

// open given link

//locate drop down element

//create objects for Select & Actions Class

Select s= new Select(e);

Actions a = new Actions(driver);

// deselect the all options from the drop down "Country"

//select the values from drop down

.keyUp(Keys.CONTROL) .build().perform();

//To get all the countries that are selected in the drop down.

{

}

// Click on search button

}

}

How to automate multi select drop down using selenium webdriver
automate multi select drop down in selenium ide
automate multi select drop down in selenium webdriver
automate multi select drop down in selenium xpath
automate multi select drop down in selenium yeast
automate multi select drop down in selenium youtube
automate multi select drop down in selenium zinc
automate multi select drop down in selenium zink
automate drop down using selenium
automate dropdown in selenium java
automate dropdown in selenium xpath
automate dropdown in selenium yeast
automate dropdown in selenium youtube
automate dropdown in selenium zinc
automate dropdown in selenium zink
dropdown automation in selenium
how to automate drop down in selenium
how to automate drop down in selenium ide
how to automate drop down in selenium webdriver
how to automate dropdown in selenium
how to automate dropdown in selenium webdriver
Рекомендации по теме
Комментарии
Автор

public class Test11

{

public static void main(String[] args) throws InterruptedException

{

//Launch the chrome browser

System.setProperty("webdriver.chrome.driver",

WebDriver driver= new ChromeDriver();

//Assign the website link to string variable


// open given link

driver.get(url);

Thread.sleep(5000);

//locate drop down element

WebElement e =

Thread.sleep(5000);

//create objects for Select & Actions Class

Select s= new Select(e);

Actions a = new Actions(driver);

// deselect the all options from the drop down "Country"

s.deselectAll();

//select the values from drop down

a.keyDown(Keys.CONTROL)

.click(s.getOptions().get(1))

.click(s.getOptions().get(3))

.keyUp(Keys.CONTROL) .build().perform();

Thread.sleep(5000);

//To get all the countries that are selected in the drop down.

List <WebElement> l = s.getAllSelectedOptions();

System.out.println("The number of countries selected in the dropdown :");

for(int i=1;i<=l.size();i++)

{

String countries =

System.out.println( countries);

}

// Click on search button



Thread.sleep(5000);

driver.close();

}

}

damuappanna
visit shbcf.ru