wait.until(ExpectedConditions) doesnt work any more in selenium

0
0

So far I used 2.45.0 version of selenium and all my waits were done in this way:

WebDriverWait wait = new WebDriverWait(webKitUtility.getWebDriver(), 5);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("role")));

But I updated selenium to 3.1.0 and I am getting the error:

“The method until(Predicate) in the type FluentWait is not applicable for the arguments
(ExpectedCondition)”

I see that from 2.45.0 to 3.1.0 some things are deprecated. I am trying to investigate what is the best way to do it now, but I am not sure. Most of the things I’m finding on google are old information explaining the same way I was using so far.

  • You must to post comments
0
0

I had the same issue.

I fixed it by using the not deprecated .until() method of WebDriverWait and by adding the following to my maven pom.xml:

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

Other than that, my code looks exactly like before.

To be more specific there are now two .until() methods.

The old one (which is deprecated):

public void until(final Predicate<T> isTrue) {}

And the new one:

public <V> V until(Function<? super T, V> isTrue) {}

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website