Skip to content
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

NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object; #26

Open
KlausHans opened this issue May 18, 2017 · 12 comments

Comments

@KlausHans
Copy link

Hello,

i tried the following:

@Test public void testLanguageSelection() { click(Elements.LOC_LNK_SELECTLANGUAGE) .validatePresent(Elements.LOC_LNK_LANGUAGEMENUE) ; }

This does not work, a NoSuchMethodError Exception appears:

java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object; at io.ddavison.conductor.Locomotive.waitForCondition(Locomotive.java:279) at io.ddavison.conductor.Locomotive.waitForCondition(Locomotive.java:274) at io.ddavison.conductor.Locomotive.waitForCondition(Locomotive.java:264) at io.ddavison.conductor.Locomotive.click(Locomotive.java:288) at io.ddavison.conductor.Locomotive.click(Locomotive.java:284) at test.SideTest.testLanguageSelection(SideTest.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

I tried other links, the error stays the same. Is it not possible to click a link? Or is it a bug?

@KlausHans
Copy link
Author

KlausHans commented May 18, 2017

Guava v19 seems to be the problem. Take a look here SeleniumHQ/selenium#3606

Edit: Nope, still got the issue after replacing the lib with Guava 21 manually.

@ddavison
Copy link
Member

ddavison commented Aug 5, 2017

this still an issue? sorry took so long to respond 😞

@crhoads1024
Copy link

Im still getting it using Guava 21

@kishoricoep
Copy link

kishoricoep commented Feb 20, 2018

I am still facing this issue with Selenium 3.9.1 and guava 21 version.
Can anyone help with this to me? I am stuck executing tests through testNG.

@ddavison
Copy link
Member

ddavison commented Apr 8, 2018

it definitely appears to be happening from invalid dependencies...

@ghost
Copy link

ghost commented Apr 9, 2018

@ddavison You are right. What I ended up doing was to exclude the guava dependency from every single dependency that leverages it, and then add the guava 23.0 dependency explicitly. That fixed the issue, but I don't believe that this is the right approach.

A better fix needs to be implemented by the proprietors.

@shankar86kd
Copy link

I am also facing the same issue.

I have latest jars in my local and added the same to libraries. We don't use maven/gradle. We build our project using ANT tool and we have all the dependency libraries in a network location and build the executable jar by ANT script.

I don't find any compilation errors but while executing our project jar, I hit the following error whenever I try to use wait.until(ExpectedConditions) :

java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.FluentWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;

Sample code which I see issue with :

public static void clickSearch(WebDriver driver,By by, int timeout){
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
WebDriverWait wait = new WebDriverWait(driver, 2);
WebElement webElement = wait.until(ExpectedConditions.elementToBeClickable(by));
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
webElement.click();
}
I have got latest java-client-6.1.0.jar, 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.

I also have few more jars in my libraries. Kindly let know if you have a solution to the same.

@Codude
Copy link

Codude commented Nov 15, 2018

any solution for this @ddavison
still getting this issue

@Jayasharma004
Copy link

I am using Selenium 3.14.0 , firefox 62.0.1, gecko driver 0.23.0

org.quartz-scheduler quartz 2.3.0
	<dependency>
		<groupId>org.quartz-scheduler</groupId>
		<artifactId>quartz-jobs</artifactId>
		<version>2.3.0</version>
	</dependency>
	<dependency>
		<groupId>com.google.guava</groupId>
		<artifactId>guava</artifactId>
		<version>26.0-jre</version>
	</dependency>

Here is my method -

public LoginPage visit() {
try {
logger.info("Opening URL: " + hostname);
DateTime startTime = DateTime.now();
getDriver().get(hostname);
new BrowserCapabilities().loginF5(getDriver()); //Added by Jaya
/new BrowserCapabilities().bProxy.newHar("LoginHAR");
Har har = new BrowserCapabilities().bProxy.getHar();
har.writeTo(new File("H:\Panorama\HarLogs\har1.har"));
/
await().atMost(180, TimeUnit.SECONDS).until(".panoramaLogoWrapper").areDisplayed();
if (!find(".panoramaLogoWrapper").isEmpty()) {
DateTime finishTime = DateTime.now();
long timeTaken = finishTime.getMillis() - startTime.getMillis();
appUtil.writeTransactionData(new Output("Panorama URL", "Panarama URl Page",
"", "", startTime, finishTime, String.valueOf(timeTaken), getDriver().getCurrentUrl()).toString());
logger.info("URL: {} successful!", hostname);
return this;
}
else {
new PageHandler(getDriver()).takePageScreenshot("Homepage_Failure");
logger.error("URL: {} failed to load.", hostname);
getDriver().close();
return null;
}
}
catch (Exception e) {
new PageHandler(getDriver()).takePageScreenshot("Homepage_Error");
logger.error("URL: {} failed to load, error: ", hostname, e);
getDriver().close();
return null;
}
}

with the above details, I am getting this error -

java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.FluentWait.until(Lcom/google/common/base/Predicate;)V
at org.fluentlenium.core.wait.FluentWait.until(FluentWait.java:98) ~[fluentlenium-core-0.10.3.jar:?]
at org.fluentlenium.core.wait.FluentWaitMatcher.until(FluentWaitMatcher.java:70) ~[fluentlenium-core-0.10.3.jar:?]
at org.fluentlenium.core.wait.FluentWaitMatcher.areDisplayed(FluentWaitMatcher.java:220) ~[fluentlenium-core-0.10.3.jar:?]
at com.panorama.controller.pages.common.LoginPage.visit(LoginPage.java:65) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.loginAsAdviser(PanoramaJob.java:127) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.adviserScenarioLogin(PanoramaJob.java:846) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.testScenario(PanoramaJob.java:1776) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.execute(PanoramaJob.java:2348) ~[classes/:?]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.3.0.jar:?]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.0.jar:?]
2018-12-06 10:41:40,478 ERROR [PANAROMA_SCHEDULER_Worker-4] org.quartz.core.ErrorLogger - Job (PanoramaScheduler.Job_EA73CD70F91411E8842135B702E8713F threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception.
at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz-2.3.0.jar:?]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.0.jar:?]
Caused by: java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.FluentWait.until(Lcom/google/common/base/Predicate;)V
at org.fluentlenium.core.wait.FluentWait.until(FluentWait.java:98) ~[fluentlenium-core-0.10.3.jar:?]
at org.fluentlenium.core.wait.FluentWaitMatcher.until(FluentWaitMatcher.java:70) ~[fluentlenium-core-0.10.3.jar:?]
at org.fluentlenium.core.wait.FluentWaitMatcher.areDisplayed(FluentWaitMatcher.java:220) ~[fluentlenium-core-0.10.3.jar:?]
at com.panorama.controller.pages.common.LoginPage.visit(LoginPage.java:65) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.loginAsAdviser(PanoramaJob.java:127) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.adviserScenarioLogin(PanoramaJob.java:846) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.testScenario(PanoramaJob.java:1776) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.execute(PanoramaJob.java:2348) ~[classes/:?]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.3.0.jar:?]
... 1 more
AppUtil.getRuntimeSettingValue method: Value from Database is: 3
2018-12-06 10:41:41,157 ERROR [PANAROMA_SCHEDULER_Worker-4] com.panorama.controller.job.PanoramaJobListener - Job 'PanoramaScheduler.Job_EA73CD70F91411E8842135B702E8713F' failed, error:
org.quartz.JobExecutionException: org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.FluentWait.until(Lcom/google/common/base/Predicate;)V]
at org.quartz.core.JobRunShell.run(JobRunShell.java:218) [quartz-2.3.0.jar:?]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.0.jar:?]
Caused by: org.quartz.SchedulerException: Job threw an unhandled exception.
at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz-2.3.0.jar:?]
... 1 more
Caused by: java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.FluentWait.until(Lcom/google/common/base/Predicate;)V
at org.fluentlenium.core.wait.FluentWait.until(FluentWait.java:98) ~[fluentlenium-core-0.10.3.jar:?]
at org.fluentlenium.core.wait.FluentWaitMatcher.until(FluentWaitMatcher.java:70) ~[fluentlenium-core-0.10.3.jar:?]
at org.fluentlenium.core.wait.FluentWaitMatcher.areDisplayed(FluentWaitMatcher.java:220) ~[fluentlenium-core-0.10.3.jar:?]
at com.panorama.controller.pages.common.LoginPage.visit(LoginPage.java:65) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.loginAsAdviser(PanoramaJob.java:127) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.adviserScenarioLogin(PanoramaJob.java:846) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.testScenario(PanoramaJob.java:1776) ~[classes/:?]
at com.panorama.controller.job.PanoramaJob.execute(PanoramaJob.java:2348) ~[classes/:?]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.3.0.jar:?]
... 1 more

Please suggest on this.

@meenuaggarwal
Copy link

I am also facing the same issue.

I have latest jars in my local and added the same to libraries. We don't use maven/gradle. We build our project using ANT tool and we have all the dependency libraries in a network location and build the executable jar by ANT script.

I don't find any compilation errors but while executing our project jar, I hit the following error whenever I try to use wait.until(ExpectedConditions) :

java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.FluentWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;

Sample code which I see issue with :

public static void clickSearch(WebDriver driver,By by, int timeout){
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
WebDriverWait wait = new WebDriverWait(driver, 2);
WebElement webElement = wait.until(ExpectedConditions.elementToBeClickable(by));
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
webElement.click();
}
I have got latest java-client-6.1.0.jar, 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.

I also have few more jars in my libraries. Kindly let know if you have a solution to the same.

Hi, I am also facing the exact same issue with Selenium 3.141.59, which is packaged with guava v25. We also use ANT instead of maven/gradle. Were you able to find the solution of this problem?

@EddieEldridge
Copy link

I am also facing the same issue.
I have latest jars in my local and added the same to libraries. We don't use maven/gradle. We build our project using ANT tool and we have all the dependency libraries in a network location and build the executable jar by ANT script.
I don't find any compilation errors but while executing our project jar, I hit the following error whenever I try to use wait.until(ExpectedConditions) :
java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.FluentWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;
Sample code which I see issue with :
public static void clickSearch(WebDriver driver,By by, int timeout){
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
WebDriverWait wait = new WebDriverWait(driver, 2);
WebElement webElement = wait.until(ExpectedConditions.elementToBeClickable(by));
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
webElement.click();
}
I have got latest java-client-6.1.0.jar, 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.
I also have few more jars in my libraries. Kindly let know if you have a solution to the same.

Hi, I am also facing the exact same issue with Selenium 3.141.59, which is packaged with guava v25. We also use ANT instead of maven/gradle. Were you able to find the solution of this problem?

Did you happen to resolve this? Having the same issue myself and can't find a fix anywhere

@snehal1602
Copy link

Update version of guava as 28.0-jre in pom.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants