Closed vamvindev closed 1 year ago
Appium v2 in image emulator_11.0_v2.0-p3
broken.
Try use older versions of image: emulator_11.0_v2.0-p2
or emulator_11.0_v2.0-p1
. It helped me.
I also faced such problem in p3 (latest image):
GET http://0.0.0.0:4723/wd/hub/status
Result: {"status":9,"value":{"error":"unknown command","message":"The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource","stacktrace":""}}
appium.stdout.log:
2023-06-13 07:54:36 INFO Application - Appium will be started without ui!
[Appium] Welcome to Appium v2.0.0-beta.71
[Appium] Attempting to load driver espresso...
[debug] [Appium] Requiring driver at /home/androidusr/.appium/node_modules/appium-espresso-driver
[Appium] Attempting to load driver flutter...
[debug] [Appium] Requiring driver at /home/androidusr/.appium/node_modules/appium-flutter-driver
[Appium] Attempting to load driver gecko...
[debug] [Appium] Requiring driver at /home/androidusr/.appium/node_modules/appium-geckodriver
[Appium] Attempting to load driver uiautomator2...
[debug] [Appium] Requiring driver at /home/androidusr/.appium/node_modules/appium-uiautomator2-driver
(node:41) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[Appium] Available drivers:
[Appium] - espresso@2.23.1 (automationName 'Espresso')
[Appium] - flutter@1.14.4 (automationName 'Flutter')
[Appium] - gecko@1.1.9 (automationName 'Gecko')
[Appium] - uiautomator2@2.25.2 (automationName 'UiAutomator2')
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[debug] [HTTP] No route found for /wd/hub/status
[HTTP] <-- GET /wd/hub/status 404 12 ms - 211
[HTTP]
[HTTP] <-- GET /favicon.ico 200 2 ms - 1150
[HTTP]
Hey @alexgoryushkin ,
Thank you so much for reaching out and your suggestion.
So, I tried the lower version, using the below command
docker run -d -p 6080:6080 -p 4723:4723 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true -e APPIUM=true --device /dev/kvm --name android-container budtmo/docker-android:emulator_11.0_v2.0-p2
And also with the latest version
docker run -d -p 6080:6080 -p 4723:4723 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true -e APPIUM=true --device /dev/kvm --name android-container budtmo/docker-android:emulator_11.0
I did a GET http://0.0.0.0:4723/wd/hub/status which resulted in the same error message you shared
{
"status": 9,
"value":
{
"error": "unknown command",
"message": "The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource",
"stacktrace": ""
}
}
Below are the appium.stdout.log for both v2.0-p2 and v2.0-p3 - It's exactly the same.
2023-06-28 02:38:14 INFO Application - Appium will be started without ui! [35m[Appium][39m Welcome to Appium v2.0.0-beta.63 [35m[Appium][39m Attempting to load driver espresso... [debug] [35m[Appium][39m Requiring driver at /home/androidusr/.appium/node_modules/appium-espresso-driver [Appium] Attempting to load driver flutter... [debug] [Appium] Requiring driver at /home/androidusr/.appium/node_modules/appium-flutter-driver [Appium] Attempting to load driver gecko... [debug] [Appium] Requiring driver at /home/androidusr/.appium/node_modules/appium-geckodriver [Appium] Attempting to load driver uiautomator2... [debug] [Appium] Requiring driver at /home/androidusr/.appium/node_modules/appium-uiautomator2-driver (node:43) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit (Use
node --trace-warnings ...
to show where the warning was created) [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [Appium] Available drivers: [Appium] - espresso@2.20.1 (automationName 'Espresso') [Appium] - flutter@1.14.3 (automationName 'Flutter') [Appium] - gecko@1.1.9 (automationName 'Gecko') [Appium] - uiautomator2@2.14.0 (automationName 'UiAutomator2') [Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use. [38;5;0m[HTTP][0m [37m-->[39m [37mGET[39m [37m/wd/hub/status[39m [38;5;0m[HTTP][0m {} [debug] [38;5;0m[HTTP][0m No route found for /wd/hub/status [38;5;0m[HTTP][0m <-- GET /wd/hub/status 404 9 ms - 211 [38;5;0m[HTTP][0m [38;5;0m[HTTP][0m [38;5;0m[HTTP][0m <-- GET /favicon.ico 200 6 ms - 1150 [38;5;0m[HTTP][0m
Meaning, Appium server is running but we are unable to get a response when my Appium is tying to hit the URL : "http://0.0.0.0:4723/wd/hub".
Any thoughts on why this is happening @budtmo ?
Would love to know if you did try to run an Appium script from your local that would be running on the emulator inside the docker container @alexgoryushkin
I think I found a solution for this issue.
I have the version 1.22.3 in my local, so the URL with 0.0.0.0:4723/wd/hub works just fine.
However with Appium 2.0 they no longer provide the base, so the URL is just 0.0.0.0:4723. Here's the issue discussing it - https://github.com/appium/appium/issues/15261
So, when I did a GET to just 0.0.0.0:4723/status, it did give me the response as expected
Also, my remote session is now created perfectly fine
[debug] [38;5;16m[AppiumDriver@e144][0m Calling AppiumDriver.getStatus() with args: [] [debug] [38;5;16m[AppiumDriver@e144][0m Responding to client with driver.getStatus() result: {"build":{"version":"2.0.0-beta.71"}} [38;5;0m[HTTP][0m <-- GET /status 200 10 ms - 47 [38;5;0m[HTTP][0m [38;5;0m[HTTP][0m [37m-->[39m [37mPOST[39m [37m/session[39m [38;5;0m[HTTP][0m {"desiredCapabilities":{"appium:appActivity":"com.wcs.witricity.feature.main.MainActivity","appium:deviceName":"Samsung Galaxy S10 30","platformName":"Android","appium:automationName":"uiautomator2","appium:platformVersion":"11","appium:appPackage":"com.wcs.witricity"},"capabilities":{"firstMatch":[{"appium:appActivity":"com.wcs.witricity.feature.main.MainActivity","appium:appPackage":"com.wcs.witricity","appium:automationName":"uiautomator2","appium:deviceName":"Samsung Galaxy S10 30","appium:platformVersion":"11","platformName":"android"}]}} [debug] [38;5;16m[AppiumDriver@e144][0m Calling AppiumDriver.createSession() with args: [{"appium:appActivity":"com.wcs.witricity.feature.main.MainActivity","appium:deviceName":"Samsung Galaxy S10 30","platformName":"Android","appium:automationName":"uiautomator2","appium:platformVersion":"11","appium:appPackage":"com.wcs.witricity"},null,{"firstMatch":[{"appium:appActivity":"com.wcs.witricity.feature.main.MainActivity","appium:appPackage":"com.wcs.witricity","appium:automationName":"uiautomator2","appium:deviceName":"Samsung Galaxy S10 30","appium:platformVersion":"11","platformName":"android"}]}] [debug] [38;5;16m[AppiumDriver@e144][0m Event 'newSessionRequested' logged at 1687924016034 (03:46:56 GMT+0000 (Coordinated Universal Time)) [Appium] Attempting to find matching driver for automationName 'uiautomator2' and platformName 'android' [Appium] The 'uiautomator2' driver was installed and matched caps. [Appium] Will require it at /home/androidusr/.appium/node_modules/appium-uiautomator2-driver [debug] [Appium] Requiring driver at /home/androidusr/.appium/node_modules/appium-uiautomator2-driver [38;5;16m[AppiumDriver@e144][0m Appium v2.0.0-beta.71 creating new AndroidUiautomator2Driver (v2.25.2) session [38;5;16m[AppiumDriver@e144][0m Checking BaseDriver versions for Appium and AndroidUiautomator2Driver [38;5;16m[AppiumDriver@e144][0m Appium's BaseDriver version is 9.3.10 [38;5;16m[AppiumDriver@e144][0m AndroidUiautomator2Driver's BaseDriver version is 9.3.10 [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m Creating session with W3C capabilities: { [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m "alwaysMatch": { [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m "platformName": "android", [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m "appium:appActivity": "com.wcs.witricity.feature.main.MainActivity", [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m "appium:appPackage": "com.wcs.witricity", [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m "appium:automationName": "uiautomator2", [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m "appium:deviceName": "Samsung Galaxy S10 30", [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m "appium:platformVersion": "11" [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m }, [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m "firstMatch": [ [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m {} [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m ] [debug] [38;5;32m[AndroidUiautomator2Driver@4d21][0m } [38;5;32m[AndroidUiautomator2Driver@4d21 (1fe72b84)][0m Session created with session id: 1fe72b84-210a-46fa-aa1e-ac80318cfe44 . . . . .
@alexgoryushkin
@budtmo I'm closing this issue.
Operating System
Windows 11
Docker Image
Appium inside docker container isn't working as expected
Expected behaviour
Appium server should be started on the designated port and should allow the Remote Driver to start and perform actions as per the script.
Actual behaviour
Appium server is not started and so the remote session isn't being initiated.
Logs
This is the docker command Iâm using to start the container
docker run -d -p 6080:6080 -p 4723:4723 -p 5555:5555 -e EMULATOR_DEVICE=âSamsung Galaxy S10â -e WEB_VNC=true -e APPIUM=true --device /dev/kvm --name android-container budtmo/docker-android:emulator_11.0
Below is my test setup in local which works perfectly in local Android emulator.
And when the test is executed, this is the response in console