String strURL;
strURL="URL";
WebDriver firefoxDriver=new FirefoxDriver();
firefoxDriver.get(strURL);
WebElement list1;
list1=firefoxDriver.findElement(By.name("lst"));
List<WebElement> lstOptions=list1.findElements(By.tagName("option"));
list1.sendKeys(Keys.CONTROL);
lstOptions.get(0).click();//Selects the first option.
lstOptions.get(1).click();//Selects the second option.
Showing posts with label Listbox multiple selection. Show all posts
Showing posts with label Listbox multiple selection. Show all posts
Thursday, October 20, 2011
Selecting Multiple Items in Listbox
Selecting multiple HTML Listbox's options
Subscribe to:
Posts (Atom)