How to select multiple options from a list box using selenium webdriver

package selenium_examples;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class spicejet {

public static void main(String[] args) {

 WebDriver driver = new FirefoxDriver();


 Select droplist = new Select(driver.findElement("idqi")));

       droplist.selectByVisibleText("Accounting / Finance");
       droplist.selectByVisibleText("Agriculture / Dairy");

Above script selects Accounting / Finance and Agriculture / Dairy from Industry list box.

selenium scripts,webdriver scripts

No comments:

Related Posts Plugin for WordPress, Blogger...