Unable to find element or open up the drop down menu.

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class TestDropDowns {

public static void main(String[] args) {

System.setProperty(“webdriver.gecko.driver”, “C:\\Users\\USER\\Desktop\\geckodriver.exe”);
DesiredCapabilities capabilities= DesiredCapabilities.firefox();
capabilities.setCapability(“marionette”, true);

WebDriver driver =new FirefoxDriver();
driver.get(“https://www.wikipedia.org/”);
WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(“.//*[@id=’searchLanguage’]”))); /*examining the xpath for a search
box*/
driver.findElement(By.xpath(“.//*[@id=’searchLanguage’]”)).sendKeys(“Eesti”);
}

}

Default Asked on February 19, 2017 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.