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

Selenide-Appium: Encountered internal error running command: NotImplementedError: Not implemented yet for pageLoad. #2612

Closed
algernon28 opened this issue Jan 21, 2024 · 7 comments · Fixed by #2628
Assignees
Milestone

Comments

@algernon28
Copy link

algernon28 commented Jan 21, 2024

The problem

The app gets started in my cucumber hook by SelenideAppium.launchApp();

However, it crashes as soon as it starts the session, apparently because pageLoadTimeout is not implemented (note that I do not set that parameter explicitly, I believe Selenide sets it by default).

Tell us about your environment

  • Selenide-Appium Version: 7.0.4
  • IOS\Android\WEB version: any
  • OS Version: Windows 10
  • Java Version: 17
  • Cucumber Version: 7.15.0

Code To Reproduce Issue

I implemented AndroidDriverProvider like this

public class AndroidDriverProvider extends BaseDriverProvider {

    public AndroidDriverProvider() {
        super();
    }

    @SneakyThrows
    @Nonnull
    @Override
    public WebDriver createDriver(@Nonnull Capabilities capabilities) {
        UiAutomator2Options options = new UiAutomator2Options().merge(capabilities);
        appendSauceOptions(options);
        AndroidDriver driver = new AndroidDriver(url, options);
        log.debug("Driver: {}", driver);
        return driver;
    }
}

appium.log

local-emu-android.json

classes.zip

@asolntsev
Copy link
Member

asolntsev commented Jan 28, 2024

@algernon28 Hi.
I don't think your app crashes because of pageLoad. I think it crashes for some reason.

About pageLoad: it doesn't really cause any problems. It just write a single INGO log:

INFO WebDriverFactory - Failed to set page load timeout to 30000 ms: org.openqa.selenium.UnsupportedCommandException: ....

After this line, some other problem happens.

P.S. To stop seeing this log, you can use method SelenideAppium.launchApp() instead of Selenide.open().
Or set explicitly Configuration.pageLoadTimeout = -1;

@algernon28
Copy link
Author

algernon28 commented Jan 28, 2024

I tried, but it seems it keeps being overwritten to 0 whatever I try. For Appium it seems it's hardcoded.
The appium session crashes constantly at that point, I couldn't see any other significant error.
And it doesn't happen if I instantiate AndroidDriver by myself, in a framework without selenide.

@asolntsev
Copy link
Member

@algernon28 Then can you please show the error message with full stack trace?

@algernon28
Copy link
Author

I believe I attached the whole appium log?
The session just crashes right after that command.
Then the app closes as consequence.
My java stacktrace only showed errors due to unknown appium session, because it closed.
The appium log is attached in the post.
The pageload is hardcoded to zero for SelenideAppium it seems.

@asolntsev
Copy link
Member

asolntsev commented Jan 28, 2024

@algernon28 No, I am asking for Java error message with full stack trace.
Can you also share the logs from android emulator?

From appium log I see that the session disappears after the pageLoad error, which kinda proves your theory:

2024-01-21 18:34:03:755 [AndroidUiautomator2Driver@ded4 (8694fd43)] Calling AppiumDriver.timeouts() with args: [null,null,null,0,null,"8694fd43-cb2b-447d-88d7-e420e8812e37"]
2024-01-21 18:34:03:760 [AndroidUiautomator2Driver@ded4 (8694fd43)] W3C timeout argument: {"pageLoad":0}}
2024-01-21 18:34:03:798 [AndroidUiautomator2Driver@ded4 (8694fd43)] Encountered internal error running command: NotImplementedError: Not implemented yet for pageLoad.

and AFTER them next lines:

2024-01-21 18:34:04:064 [AndroidUiautomator2Driver@ded4 (8694fd43)] Calling AppiumDriver.findElement() with args: ["xpath","//android.webkit.WebView[@text='Edenred Connect']","8694fd43-cb2b-447d-88d7-e420e8812e37"]

2024-01-21 18:34:04:567 [AndroidUiautomator2Driver@ded4 (8694fd43)] Got response with status 404: {"sessionId":"2da370cf-d4ad-4aac-a423-91ef0e63692e","value":{"error":"invalid session id","message":"The session identified by 2da370cf-d4ad-4aac-a423-91ef0e63692e is not known"....

P.S. Yes, you are right: "pageLoad = 0" is hardcoded in SelenideAppium, and this is a bug. Will fix it in Selenide 7.1.0. But I still don't think it causes the app crash.

@algernon28
Copy link
Author

It's the appium session that crashes.
I don't have the android logs at hand, I will gather them next time I have a chance to run it again if you think they are useful.

asolntsev added a commit that referenced this issue Jan 28, 2024
it was a bug that we set "pageLoadTimeout" to 0. It caused the endless messages "NotImplementedError: Not implemented yet for pageLoad" in logs, and maybe even app crash (not proven).

when "pageLoadTimeout" is -1, then Selenide doesn't even try to set it.
@asolntsev asolntsev linked a pull request Jan 28, 2024 that will close this issue
@asolntsev asolntsev self-assigned this Jan 28, 2024
@asolntsev asolntsev added this to the 7.1.0 milestone Jan 28, 2024
asolntsev added a commit that referenced this issue Jan 28, 2024
it was a bug that we set "pageLoadTimeout" to 0. It caused the endless messages "NotImplementedError: Not implemented yet for pageLoad" in logs, and maybe even app crash (not proven).

when "pageLoadTimeout" is -1, then Selenide doesn't even try to set it.
@asolntsev
Copy link
Member

page load timeout fixed by #2628

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

Successfully merging a pull request may close this issue.

2 participants