Closed Bug 1607996 Opened 5 years ago Closed 5 years ago

Delete session fails when using geckodriver on Firefox for Android

Categories

(Testing :: geckodriver, defect, P3)

68 Branch
All
Android
defect

Tracking

(firefox-esr68 fixed)

RESOLVED DUPLICATE of bug 1298921
Tracking Status
firefox-esr68 --- fixed

People

(Reporter: vruno.alassia, Unassigned)

References

Details

Attachments

(1 file)

Attached file geckodriver.log

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36

Steps to reproduce:

Hello! I'm contributing to the appium open-source project and wanted to add support for geckodriver for Firefox on Android but encountered issues when trying to delete the running session.

[STDOUT] 1578536136663 webdriver::server       DEBUG   -> DELETE /session/71a5d49a-55cf-42e6-853c-36e55ec8c62b {}
dbug Geckodriver [STDOUT] 1578536136671 webdriver::server       DEBUG   <- 500 Internal Server Error {"value":{"error":"unsupported operation","message":"Only supported in Firefox","stacktrace":"WebDriverError@chrome://marionette/content/error.js:4:250\nUnsupportedOperationError@chrome://marionette/content/error.js:37:77\nassert.that/<@chrome://marionette/content/assert.js:5:513\nassert.firefox@chrome://marionette/content/assert.js:1:1325\nGeckoDriver.prototype.quit@chrome://marionette/content/driver.js:133:8\ndespatch@chrome://marionette/content/server.js:21:34\nexecute@chrome://marionette/content/server.js:18:170\nonPacket/<@chrome://marionette/content/server.js:17:50\nonPacket@chrome://marionette/content/server.js:17:65\n_onJSONObjectReady/<@chrome://marionette/content/transport.js:23:125\n"}}```

My environment:
* geckodriver 0.26.0 on macOS Catalina
* Firefox 68.4.1 on Android real device, for my its a Pixel 1 using Android 10. 

I can reproduce the issue by building geckodriver from source using latest commit by January 3rd.

hangeset: 508740:5fd4cfacc90d
tag: tip
user: Justin Wood <Callek@gmail.com>
date: Fri Jan 03 22:06:19 2020 +0200
summary: Bug 1606899 - Fix 'NameError: global name ...' error which regressed from Bug 1604749. r=tomprince a=releng DONTBUILD


Steps to reproduce; 
Preparing the environment
1. git clone git@github.com:vrunoa/appium-geckodriver.git
2. cd appium-geckodriver
3. npm install
Running the test
1. npm run build && ./node_modules/.bin/mocha -t 0 ./build/test/functional/geckodriver-e2e-specs.js --verbose --exit --bail

This can also be reproduced using any selenium client as I can reproduce it using the python client. 


Actual results:

When trying to delete the session geckodriver is raising this error:

dbug WD Proxy Proxying [DELETE /] to [DELETE http://127.0.0.1:29146/session/71a5d49a-55cf-42e6-853c-36e55ec8c62b] with body: {}
dbug Geckodriver [STDOUT] 1578536136663 webdriver::server DEBUG -> DELETE /session/71a5d49a-55cf-42e6-853c-36e55ec8c62b {}
dbug Geckodriver [STDOUT] 1578536136671 webdriver::server DEBUG <- 500 Internal Server Error {"value":{"error":"unsupported operation","message":"Only supported in Firefox","stacktrace":"WebDriverError@chrome://marionette/content/error.js:4:250\nUnsupportedOperationError@chrome://marionette/content/error.js:37:77\nassert.that/<@chrome://marionette/content/assert.js:5:513\nassert.firefox@chrome://marionette/content/assert.js:1:1325\nGeckoDriver.prototype.quit@chrome://marionette/content/driver.js:133:8\ndespatch@chrome://marionette/content/server.js:21:34\nexecute@chrome://marionette/content/server.js:18:170\nonPacket/<@chrome://marionette/content/server.js:17:50\nonPacket@chrome://marionette/content/server.js:17:65\n_onJSONObjectReady/<@chrome://marionette/content/transport.js:23:125\n"}}```

Expected results:

Finished the geckodriver/marionette session properly as it does for desktop Firefox.
I found another bug talking about this issue saying its addressed.
https://bugzilla.mozilla.org/show_bug.cgi?id=1525126

OS: Unspecified → Android
Hardware: Unspecified → ARM

Thanks for filing Bruno. I had a look at your comment and something which I haven't seen before is that you are using Firefox 68. That version of Firefox for Android doesn't have my fix from bug 1298921. So quitting Firefox is not possible.

Given that we want users to continue testing with Fennec until it is no longer supported I will request an uplift of my patch for the 68 branch. Doing that the next release of Firefox 68 ESR (Feb 11th) will work as expected. Until then you could test with nightly builds.

Component: Testing → geckodriver
Depends on: 1525126, 1298921
Product: Firefox for Android → Testing
Hardware: ARM → All
Version: Firefox 68 → unspecified
Status: UNCONFIRMED → NEW
Ever confirmed: true

Henrik thanks for your feedback, we'll implement some workaround on Appium side to stop geckodriver and stopping Firefox app on the Android device as an alternative for deleting the session if Firefox version is 68.x.
Can you share the link on where can I download the nightly builds apks? I have only been installing official firefox from Google Play Store.

It's not in Firefox 68 ESR yet. We will have to wait until bug 1298921 has been uplifted.

But this should be fixed in newer firefox versions. rigtht? LIke 69? Are those available for Android?

No. There is no more Fennec release after 68. Starting with 69 there is Firefox Preview currently in the Play Store, which is based on GeckoView. For details see e.g https://hacks.mozilla.org/2019/06/geckoview-in-2019/.

Yes, that is clearly something different, which I haven't seen when first implementing support for Android. Please test again without the androidActivity setting in capabilities because geckodriver retrieves the default one by itself. If that still doesn't work please file a new bug. For now I tagged your last comment as obsolete to not cause confusion on this bug.

Priority: -- → P3
Version: unspecified → 68 Branch

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #7)

Yes, that is clearly something different, which I haven't seen when first implementing support for Android. Please test again without the androidActivity setting in capabilities because geckodriver retrieves the default one by itself. If that still doesn't work please file a new bug. For now I tagged your last comment as obsolete to not cause confusion on this bug.

I expect you want androidActivity to be org.mozilla.fenix.IntentReceiverActivity, which knows how to open about:blank so that Gecko is ready to load URIs under test.

The patch on bug 1298921 got uplifted and the correct behavior is available now via the following release-channel Fennec nightly build:

https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/O7AvGEP0TuaSE_E6etVnKw/runs/0/artifacts/public/build/target.apk

Would you mind trying it out, and report back how it works? Thanks.

Flags: needinfo?(vruno.alassia)

Perfect, this apk works! I'll put in the requirements from Appium side that Firefox 68.5.0 is the min version.
Should I create another bug in regards of geckodriver wont be able to start a session using the Firefox preview? Or can we continue the conversation here?

Flags: needinfo?(vruno.alassia)

Btw, is there an official URL artifact for X86/X86_64 apks? This .apk is arm64-v8a, and I would like to add e2e from Appium side, but we only have emulators which are x86.

(In reply to vruno.alassia from comment #10)

Perfect, this apk works! I'll put in the requirements from Appium side that Firefox 68.5.0 is the min version.
Should I create another bug in regards of geckodriver wont be able to start a session using the Firefox preview?

Yes -- but be aware that we're testing this in automation, so it definitely works for us in some situations. Follow the arguments listed at https://searchfox.org/mozilla-central/rev/4326179fd31f915f440f022b1f1a4e8cf7703241/taskcluster/ci/test/raptor-fenix.yml#42-43, with the exception that org.mozilla.fenix should work.

Or can we continue the conversation here?

New tickets for new issues, please.

(In reply to vruno.alassia from comment #11)

Btw, is there an official URL artifact for X86/X86_64 apks? This .apk is arm64-v8a, and I would like to add e2e from Appium side, but we only have emulators which are x86.

Yes: https://archive.mozilla.org/pub/mobile/releases/68.5b3/ and sub-directories. (I don't see the actual 68.5 release yet.)

Perfect Nick, I'll create a new bug. Thanks for sharing the releases, we'll add CI on appium side too.

Created a new bug for Firefox Preview session failing to start; https://bugzilla.mozilla.org/show_bug.cgi?id=1610194. This ticket can be closed.

Great to hear. So that bug is basically a dupe of bug 1298921.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: