Skip to content

bug: AppiumFluentWait -> Cannot access org.openqa.selenium.support.ui.FluentWait #2012

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
AlessandroMiccoli opened this issue Sep 12, 2023 · 9 comments · Fixed by #2019
Closed

Comments

@AlessandroMiccoli
Copy link
Contributor

Description

I am trying to use AppiumFluentWait. Previously, with the version 7.6.0, I was able to do

new AppiumFluentWait<AppiumDriver<?>>(appiumDriver)
                .withTimeout(Duration.ofMillis(maxWait))
                .pollingEvery(Duration.ofMillis(interval))
                .ignoring(NoSuchElementException.class)
                .ignoring(TimeoutException.class)
                .until(ExpectedConditions.visibilityOfElementLocated(by));

With version 8.5.1, I got: Cannot access org.openqa.selenium.support.ui.FluentWait when I try to use AppiumFluentWait.

Is it a bug or I am missing something for this implementation?

@mykola-mokhnach
Copy link
Contributor

Most likely something has been changed in selenium so the reflection access is broken now and needs to be updated.
So yeah, lets assume it is a bug

@mykola-mokhnach
Copy link
Contributor

Please provide the full stacktrace as well

@AlessandroMiccoli
Copy link
Contributor Author

Sorry for my late reply. This is a screenshot that summarises the problem.

Screenshot 2023-09-15 at 16 20 22

Temporary fix

Add the dependency to your project -> implementation 'org.seleniumhq.selenium:selenium-support:4.8.3'

Fix to appium

Add this to the build.gradle

api ('org.seleniumhq.selenium:selenium-support') {
    version {
        strictly "[${seleniumVersion}, 5.0)"
        prefer "${seleniumVersion}"
    }
}

Let me know if it makes sense for you, so I will create a PR.

@mykola-mokhnach
Copy link
Contributor

@valfirst @SrinivasanTarget Are you able to reproduce the above issue?

@ashwithpoojary98
Copy link
Contributor

@AlessandroMiccoli it's working fine
new AppiumFluentWait<>(appiumDriver)
.withTimeout(Duration.ofMillis(maxWait))
.pollingEvery(Duration.ofMillis(interval))
.ignoring(NoSuchElementException.class)
.ignoring(TimeoutException.class)
.until(ExpectedConditions.visibilityOfElementLocated(by));

@saikrishna321
Copy link
Member

@mykola-mokhnach I'm unable to reproduce this problem. Using the latest java-client

@AlessandroMiccoli
Copy link
Contributor Author

AlessandroMiccoli commented Sep 19, 2023

@ashwithpoojary98 are you using io.appium:java-client:8.5.1 without implementing separately org.seleniumhq.selenium:selenium-support:4.8.3? If yes, on my IntelliJ I don't see selenium-support in the compile classpath:

Screenshot 2023-09-19 at 13 30 31

Could you provide me with the whole implementation with the import, etc...

In fact, the appium library has this build.gradle:

    api ('org.seleniumhq.selenium:selenium-api') {
        version {
            strictly "[${seleniumVersion}, 5.0)"
            prefer "${seleniumVersion}"
        }
    }
    api ('org.seleniumhq.selenium:selenium-remote-driver') {
        version {
            strictly "[${seleniumVersion}, 5.0)"
            prefer "${seleniumVersion}"
        }
    }
    implementation ('org.seleniumhq.selenium:selenium-support') {
        version {
            strictly "[${seleniumVersion}, 5.0)"
            prefer "${seleniumVersion}"
        }
    }

There is not api for org.seleniumhq.selenium:selenium-support.

@ashwithpoojary98
Copy link
Contributor

@AlessandroMiccoli I'm using Appium client 8.5.1

@AlessandroMiccoli
Copy link
Contributor Author

@AlessandroMiccoli I'm using Appium client 8.5.1

@ashwithpoojary98 I am using the same.

Do you import org.seleniumhq.selenium:selenium-support:4.8.3 separately in your project? Do you manipulate the import of io.appium:java-client:8.5.1 in some ways?

Please, could you share your code on git?

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

Successfully merging a pull request may close this issue.

4 participants