SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.63k stars 8.18k forks source link

[🐛 Bug]: Getting compile time error on Explicit waits. #11472

Closed Biswajeet-webonise closed 1 year ago

Biswajeet-webonise commented 1 year ago

What happened?

Getting compile time error on Explicit waits. This was working untill Yesterday

How can we reproduce the issue?

WebDriverWait wait=new WebDriverWait(driver, Duration.ofSeconds(20));
        WebElement checkOutButton = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@class='checkoutBox clearfix emptyCartContentWrap']//a[@id='checkoutCart']")));

Relevant log output

Here the issue logged on console is: java: method until in class org.openqa.selenium.support.ui.FluentWait<T> cannot be applied to given types;
  required: java.util.function.Function<? super org.openqa.selenium.WebDriver,V>
  found:    org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement>
  reason: cannot infer type-variable(s) V
    (argument mismatch; org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement> cannot be converted to java.util.function.Function<? super org.openqa.selenium.WebDriver,V>)

Operating System

Windows 10

Selenium version

4.1.3

What are the browser(s) and version(s) where you see this issue?

Build issue

What are the browser driver(s) and version(s) where you see this issue?

Latest chrome Beta

Are you using Selenium Grid?

No

github-actions[bot] commented 1 year ago

@Biswajeet-webonise, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

Biswajeet-webonise commented 1 year ago

Found out the root cause. It worked after adding the below mentioned Guava dependency to pom.xml

com.google.guava guava 31.0.1-jre