I initialized and set my driver as below:
System.setProperty("webdriver.firefox.bin", Vars.FFPATH);
System.setProperty("webdriver.gecko.driver", "C:\\geckodriver.exe");
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setAcceptInsecureCerts(true);
WebDriver driver = new FirefoxDriver(desiredCapabilities);
driver.navigate().to(siteurl);
driver.manage().timeouts().implicitlyWait(30, SECONDS);
I assume, it should wait for 30 seconds before executing rest of code. It doesn't work, there is no waiting time, execution takes only 8 seconds. I tried to use FluentWait to to make some waiting time by waiting for elemnt to be clickable.
FluentWait<WebDriver> wait = new WebDriverWait(driver, 5);
wait.until(ExpectedConditions.elementToBeClickable(webpage.linput));
Error message:
java.lang.NullPointerException at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:787) at org.openqa.selenium.support.ui.FluentWait.(FluentWait.java:102) at org.openqa.selenium.support.ui.WebDriverWait.(WebDriverWait.java:71) at org.openqa.selenium.support.ui.WebDriverWait.(WebDriverWait.java:45)
I checked variable webpage.linput
with Logger
and it has a valid value, the xpath for the given element, so it is not null.
Variable created here:
By linput = By.xpath("//*[@id=\"formA\"]/p[1]/label");
Versions:
WebDriver 3.5.2
GeckoDriver 0.18.0
Firefox 55.0.3