maxwu / cucumber-java-toy

♖ Demo to show Selenium PageObjects with JUnit in Cucumber-JVM on unit conversion and GeoIP location
1 stars 3 forks source link

Upgrading selenium from 3.0.1 to 3.1.0, WebDriverWait.until method cannot be resolved #6

Open maxwu opened 7 years ago

maxwu commented 7 years ago

There is a new but missing dependency with selenium 3.1.0. Which causes below instruction fail to resolve by javac error: no suitable method found for until(ExpectedCondition).

By byDiv = By.cssSelector("div#resultStats");
WebDriverWait wait = new WebDriverWait(dr, 10);
wait.until(ExpectedConditions.visibilityOfElementLocated(byDiv));
maxwu commented 7 years ago

It is google lib missing by selenium 3.1.0 declaration, if fall back the maven pom to selenium 3.0.1, the same codes work well. To resolve problem with selenium-java 3.1.0, below dependency block shall be added to element tree.

<dependency>
     <groupId>com.google.guava</groupId>
     <artifactId>guava</artifactId>
     <version>21.0</version>
</dependency>
maxwu commented 7 years ago

There is a same issue on Selenium Issue board with same recommended solution.