This blog is for Automation Test Engineers

Saturday, 2 September 2017

How to select random options in multiple select dropdown box and print them

WebDriver driver=new FirefoxDriver();
driver.get("https://www.facebook.com/");
WebElement day=driver.findElement(By.id("day"));
Select sel=new Select(box);
sel.selectByIndex(0);
sel.selectByIndex(1);
sel.selectByIndex(2);
List<WebElement>list=sel.getAllSelecetedOptions();

System.out.println(list.size());

0

0 comments:

Post a Comment