-
-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FluentWait changes WebDriverWait().until(ExpectedCondition...) fails with java.lang.NoSuchMethodError #3606
Comments
I was checking the change log for 3.2.0 here, and it says:
I think this is related to your error. |
@diemol Actually, this issue does not appear to be related to the deprecated The issue deals with the parameter The method is looking for a |
Actually, I just read the selenium/java/CHANGELOG for version 3.2.0. They upgraded to guava-21.jar |
You are completely right @smathistad, the Guava upgrade is the reason. Somehow I overlooked that part. |
Uhhh. So what is the resolution? I have a Java Maven project and all I have for selenium in pom is org.seleniumhq.selenium All my fluentwaits are broken since the update. How do I resolve this? Do I just figure out how to add guava to pom? Do I need to change wait signature? Are the docs for waits updated with new examples? |
Hi all,
In this way maven always resolve conflict with version from dependencyManagement |
Yes, I am also getting the same issue with guava version as Latest, My issue get resolved when I mentioned the guava version as 21 in dependency. |
I have guava 21.0 added to my pom.xml, running mvn -f pom.xml compile test, the test passed, wait.until is working fine! Setup: POM.xml
|
Have the same problem. Got the same error when running via testng.xml. Also cannot run via Eclipse, got the same error as well. My settings: |
Have the same problem. Got the same error when running via testng.xml. Also cannot run via Eclipse - My settings: I tried different configurations. Second try from searching google. Third try from searching google. Anyone solve this issue with testNG? |
This issue happened to me when I added a new dependency to my pom file and re-arranging the new dependency to a lower order in the list seemed to have fixed the issue .. |
Using guava version 21, still facing this issue. Any solution found for this? Please help. |
Here is my workaround:
|
@ivnl , Could you please post your maven pom file. I am trying to update with guava dependency 21 version with selenium 3.9.1 but issue is still there. java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until(Ljava/util/function/Function;)Ljava/lang/Object; |
I updated below lines in my gradle file and it resolved above NosuchErrorMethod compilation error for 'webdriverwait.until() method'
PS : Looking at release notes for guava core , it seems it has been bifurcated under two libraries (1 jre , 2 android) |
Any one get this working with selenium 3.10.0 and guava 21 ? |
I am also facing this issue. I dont quite understand why this issue was closed when it is clearly a common occurrence. Can someone from the Selenium team please re-open this issue? |
@mirza-ae Yes, misconfiguring classpath is a common occurrence, but it's not a bug that can be fixed in Selenium code, you should fix dependencies in your project. |
I am using Selenium 3.13.0 jars and with guava 26.0-jre.jar. I see the following exception whenever I am trying to use WebDriverWait.until(ExpectedConditions): Sample Code which is hitting issue: public static void clickSearch(WebDriver driver,By by, int timeout){
Java JDK : 1.8.0_131-b11 I am still facing this issue. |
Even I have faced the same issue adding guva and selenium-support dependencies resolved my issue. if you are still facing the issue then update selenium standalone server to the selenium version that you are using. there is no maven dependency for selenium standalone server so you have to download the required version and add it to build path. Note : After adding all above dependencies, delete selenium folder from .m2 folder and build it. All the best. |
As mentioned already in my previous comment, I have got latest guava 26.0-jre.jar and following selenium jars : selenium-api-3.13.0.jar, selenium-java-3.13.0.jar, selenium-remote-driver-3.13.0.jar, selenium-server-standalone-3.13.0.jar, selenium-support-3.13.0.jar, client-combined-3.13.0.jar. Even though I have the above mentioned jars I am seeing this issue. I have many other jars in classpath too. Not sure if any of them is causing the issue. |
@shankar86kd : In your list you do not have selenium support dependency added. As mentioned in my comment, add this dependency and delete selenium from .m2 folder in your location system and rebuild the project again. It should work. org.seleniumhq.selenium selenium-support 3.13.0 |
@BalurQA I have selenium-support-3.13.0.jar. And I am not using maven or gradle. We are manually adding the jars in our library. Any help would be appreciated. Thanks ! |
@shankar86kd : i tried with little lower versions with Java project by adding below jars then it worked for me. I have added all jars manually. |
@BalurQA Yes it was working fine for me when I was on 3.4.0 version. I am trying to upgrade now to latest selenium version as the old version doesnt support latest FF and IE drivers. Hence blocked with this issue. |
@shankar86kd : Try deleting/removing the selenium-java-3.13.0.jar from library path since you already have selenium-server-standalone-3.13.0.jar. I hope it will work. When I tried with 3.14 version it did work for me. |
Updated the guava jar to 23.0 the issue is resolved |
Getting similar issue even after trying all the combinations mentioned in the comments. |
In this specific instance, https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/support/ui/FluentWait.java#L36 |
@idontusenumbers [1] https://github.com/google/guava/wiki/Release21#commonbase |
I dug a little deeper and found the latest https://github.com/docker-java/docker-java still uses guava 19. Probably still worth replacing the references in the Selenium code base to use the standard library. |
@idontusenumbers The proposed change would hurt our users that have custom conditions returning a |
@barancev it could be done in 4.0; the fix to the user code is easy. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Meta
OS: Windows 7
Selenium Version: 3.2.0
Browser: Chrome (problem is not related to browser)
Browser Version: 56.0.2924.87 (64-bit)
Java: jdk 1.8 (latest)
Problem
I had the following setup:
OS: Windows 7
Selenium Version: 3.0.1
Browser: Chrome (problem is not related to browser)
Browser Version: 56.0.2924.87 (64-bit)
Java: jdk 1.8 (latest)
I was using guava - 18.0 version and had a tests which were running fine.
Then I decided to upgrade the whole selenium grid environment to use 3.2.0 webdriver. I went through the changes and updated the pom.xml file to use 3.2.0 selenium-java and guava 21.0.
Then I ran the same tests and all of them failed in the following code fragment:
with the following reason:
Expected Behavior
If the error above is expected please add some suggestions how to use WebDriverWait + ExpectedConditions
Actual Behavior
The tests are failing because of the changes done related to FluentWait. Same piece of code works fine with 3.0.1 and guava 18.0.
Steps to reproduce
Thank you in advance!
The text was updated successfully, but these errors were encountered: