3

I have upgraded my selenium webdriver to 3.2.0 from 3.0.1 and observed that

WebDriverWait wait = new WebDriverWait(Driver, 30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("myID"));

if displaying compilation error as below:

The method

until((java.util.function.Function<? super 
 org.openqa.selenium.WebDriver, V>) 
 ExpectedConditions.visibilityOfElementLocated(By.id("myID")));

When I move back to selenium 3.0.1 it is working as expected.

Is there a problem with 3.2.0 or 3.3.1, how to fix this issue

2 Answers2

6

Update your guava package to version 21

Lucas Tierney
  • 2,503
  • 15
  • 13
2

FluentWait method until() is Deprecated in lattest selenium support 3.2.0 and up. If you really needed use the latest version of selenium and want to use selenium-support fluent wait, then can use selenium-support 3.0.1. Selenium 3.2.0 contains selenium support 3.2.0 which does not support until(). If you are using can just add the following dependency

   <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-support</artifactId>
        <version>3.0.1</version>
    </dependency>
Akbar
  • 45
  • 4
  • At last I could use below code to fix the issue – Sreekanth Simhadri Mar 11 '17 at 01:19
  • WebDriverWait wait = new WebDriverWait(Driver, 30); Function myFunction = new Function() { public Boolean apply(WebDriver arg0) { System.out.println("Checking for the object!!"); WebElement element = arg0.findElement(By.id("dynamicText")); if (element != null) { System.out.println("A new dynamic object is found."); } return true; } }; wait.until(myFunction); – Sreekanth Simhadri Mar 11 '17 at 01:25