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

5.0.0-BETA5: parameter type conflict #592

Closed
amedvedjev opened this issue Mar 7, 2017 · 15 comments
Closed

5.0.0-BETA5: parameter type conflict #592

amedvedjev opened this issue Mar 7, 2017 · 15 comments
Labels

Comments

@amedvedjev
Copy link

amedvedjev commented Mar 7, 2017

Description

WebElement element = wait.until(ExpectedConditions.visibilityOf(el));
->
Error:(235, 38) 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>)
@TikhomirovSergey
Copy link
Contributor

@amedvedjev Are you sure that it is appium issue?

@amedvedjev
Copy link
Author

amedvedjev commented Mar 7, 2017

@TikhomirovSergey of course not :-). but it appears when i switch pom.xml to latest 5th version.
Can you use mentioned in your code without issue?

now reverted back to 4th.

thanks for any idea what to check.

@amedvedjev
Copy link
Author

amedvedjev commented Mar 7, 2017

ok. indeed. thanks for help.
SeleniumHQ/selenium#3606

@amedvedjev
Copy link
Author

anyway the issue started appear in Selenium 3.2.0. Do we need to use buggy version of selenium?

@TikhomirovSergey
Copy link
Contributor

@amedvedjev It was not expected. You can exclude 3.2.0 at the configuration

@amyreit
Copy link

amyreit commented Mar 16, 2017

I am confused - I also have just moved up versions - to selenium 3.3.1 using the java package and I am seeing the same issue on a line of code like this -
element = wait.until(ExpectedConditions.elementToBeClickable((By) identifier));

error: cannot access Function
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt("toolIFrame"));
required: Function<? super WebDriver,T>
found: ExpectedCondition
reason: cannot infer type-variable(s) T
(argument mismatch; ExpectedCondition cannot be converted to Function<? super WebDriver,T>)
where T,F are type-variables:
T extends Object declared in method until(Function<? super F,T>)
F extends Object declared in interface Wait

It looks like this was a guava issue? I don't understand what the fix is - it looks like the issues for this are closed?

@amyreit
Copy link

amyreit commented Mar 16, 2017

If I back down to the 3.0.0 level of selenium then i can compile again...

@epitosoft
Copy link

epitosoft commented Mar 20, 2017

@amyreit You are correct; there is somewhat of a conflict if you use the latest version of Selenium. What ended up resolving issues for me was including the latest version of guava within my pom.xml; even though I had not used it.

<dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
            <version>3.3.1</version>
</dependency>

@amyreit
Copy link

amyreit commented Mar 20, 2017

I don't have a pom file - I'm using eclipse and java.... so not sure how to make this compile work? The guava 21 is included in my classpath....

@ublanquet
Copy link

Tried to add latest guava to my pom, didn't make a difference. Making an anonymous function as advised by http://stackoverflow.com/a/42546102 to match the signature is a workaround, but for a first time selenium user, I gotta admit I prefer to rely on the official documentation, so I downgraded to 3.0.1. Especially since I'm not sure of the usage of ExpectedConditions static methods in that context.
Seems to be more of the documentation requiring an update, but having the first main doc example fail to compile doesn't get you started on the right foot.

@SrinivasanTarget
Copy link
Member

SrinivasanTarget commented Mar 23, 2017

Especially since I'm not sure of the usage of ExpectedConditions static methods in that context.
Its an issue in Selenium Server latest where in it should be fixed if you exclude guava from java-client and add latest guava by yourself. If possible will raise a PR and fix it at selenium end soon.

@yodaqua
Copy link

yodaqua commented May 11, 2017

Instead of com.google.guava.guava I'm using com.google.inject.juice 3.0 with selenium-java 3.4.0. My maven project builds with no problem. However if I use com.google.inject.juice 4.x then I encounter the same issues described above.

@NurdinKehe
Copy link

I updated https://mvnrepository.com/artifact/com.google.guava/guava to the latest version "23.0". It fixed my problem.

@chethanshetty09
Copy link

chethanshetty09 commented Nov 13, 2017

I too had faced the same issue and the issue got solved with adding below dependencies in my pom file:

<dependency>
         <groupId>io.appium</groupId>
         <artifactId>java-client</artifactId>
         <version>5.0.0-BETA6</version>
         <exclusions>
             <exclusion>
                 <groupId>com.google.guava</groupId>
                 <artifactId>guava</artifactId>
             </exclusion>
         </exclusions>
     </dependency>
     <dependency>
         <groupId>com.google.guava</groupId>
         <artifactId>guava</artifactId>
         <version>23.0</version>
     </dependency>
     <dependency>
         <groupId>org.seleniumhq.selenium</groupId>
         <artifactId>selenium-java</artifactId>
         <version>3.4.0</version>
     </dependency>

Issue is resolved now :) Thank you!

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

No branches or pull requests

9 participants