I am trying to add explicit wait before each and every web element in the test script
My code has
import org.openqa.selenium.support.ui.Wait;
import org.openqa.selenium.support.ui.WebDriverWait;
.
.
WebDriverWait wait = new WebDriverWait(driver, 60);
wait.until(presenceOfElementLocated(By.id("name")));
driver.findElement(By.id("name")).clear();
driver.findElement(By.id("name")).sendKeys("Create_title_01");
The error I see is:
java.lang.NullPointerException
at org.openqa.selenium.support.ui.FluentWait$1.apply(FluentWait.java:176)
at org.openqa.selenium.support.ui.FluentWait$1.apply(FluentWait.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:201)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:174)
Thanks
For using presenceOfElementLocated and other AjaxCondition methods
you should use
class. Your code should be like this: