Friday, 17 February 2012

How to select Dropdown values using Selenium(Webdriver) for selenium automation testing


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


public class dadabhagwan_LearnSeleniumWithJasmine {

public static void main(String[] args) throws InterruptedException {

WebDriver myDriver = new FirefoxDriver();
myDriver.get("http://www.artofliving.org");


myDriver.findElement(By.id("div-local-center-title")).click();
myDriver.findElement(By.id("edit-state-selector")).sendKeys("Chandigarh");



}

}