- 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.