Hi all,
I wrote the following program in printing the values from the dropdownlist:
package testproject;
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 Xyz {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
String BaseUrl = "
http://newtours.demoaut.com/";
driver.get(BaseUrl);
driver.findElement(By.linkText("Register here")).click();
driver.get("
http://newtours.demoaut.com/mercuryregister.php");
Select drpCountry = new Select(driver.findElement(By.name("country")));
drpCountry.selectByVisibleText("ANTARTICA");
driver.close();
System.exit(0);
}
}
I am getting the following error , when i run this program:
at org.openqa.selenium.support.ui.Select.selectByVisibleText(Select.java:149)
at testproject.Xyz.main(Xyz.java:18)
Can anyone please help me with this.
Thanks,
Varisa