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;
import org.openqa.selenium.support.ui.Select;



public class spicejet {

public static void main(String[] args) {


 WebDriver driver = new FirefoxDriver();

 driver.get("http://jobsearch.naukri.com/mynaukri/mn_newsmartsearch.php");

 Select droplist = new Select(driver.findElement(By.id("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...