NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until selenium selenium

NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until


I think your problem is in this line of code

WebElement element=wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("dnn_dnnUser_enhancedRegisterLink")));

As Wait.until is used to tell your web driver to wait until a certain action to occur which is visibility of The element located by ID = "dnn_dnnUser_enhancedRegisterLink" in your case but this method Doesn't return a web element object so you can't use it to define a web element

Instead you just need to write :

wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("dnn_dnnUser_enhancedRegisterLink")));


Selenium 3.1.0 onwards needs guava 21 for the wait.until method.Try adding this to your pom, preferable near the top in case another dependency is importing and older version of guava:

<dependency>    <groupId>com.google.guava</groupId>    <artifactId>guava</artifactId>    <version>21.0</version></dependency>


It worked with latest jars:

Appium 1.8.1Java-client 5.0.4Selenium-java 3.7.1