shamanec / GADS

Simple device farm for remote control of devices and Appium test execution on iOS/Android
MIT License
47 stars 10 forks source link

Unable to take control #82

Closed rajeshj93 closed 5 months ago

rajeshj93 commented 6 months ago

Hi, We have successfully setup the environment. Instead of running Mongodb server through docker, we have downloaded the mongodb from homebrew and started the server. With this setup our GADS-UI is up and running.

When we do the setup for GADS-device-provider, we we able to see the list of devices got connected in th3 GADS-UI but not able to take control as it is showing N/A.

We you please suggest what might went wrong @shamanec

shamanec commented 6 months ago

You can examine the provider.log file in the logs folder for the provider to see if the set up for the devices actually goes through or there are errors. You can also run the provider with flag --log_level=debug - this will show more verbose log output in the provider.log file. You can also contact me on discord (username: shamanec), I can reply faster there :)

shamanec commented 6 months ago

I honestly have no idea, I've only actually tested Mongo with docker but this looks like the provider cannot access Mongo on that address. Is everything on the same machine?

shamanec commented 6 months ago

Are you providing 127.0.0.1:27017 in the provider config? Have you tried 0.0.0.0 or the machine IP address just in case? If GADS-UI connects to Mongo, then provider should connect as well... Can you delete the provider.log file, run the provider with log level debug and share the whole log output?

shamanec commented 6 months ago

I don't see the error here though 🤔 Maybe the docker mongo has something set up automatically that isn't for the brew Mongo instance, I have to test it with Mongo from brew to debug :( Strange phenomenon

rajeshj93 commented 6 months ago

Sure can you please let me know if you find anything that might help me to resolve this issue ?

shamanec commented 6 months ago

Using a fresh Mongo brew instance:

  1. mongod --port=27030 --dbpath=/Users/shamanec/test-mongo --bind_ip=192.168.1.6 - with this command I can connect with the provider on 192.168.1.6:27030
  2. mongod --port=27030 --dbpath=/Users/shamanec/test-mongo - with this command without binding IP I can connect with the provider on localhost:27030. On 192.168.1.6:27030 I am getting the error you were getting.

Also in the logs you provided there is no error and the provider seems to have started successfully, just saying no devices are connected

rajeshj93 commented 6 months ago

So if i go with the first command shared by you, i will be able to establish a connection & able to control/access the devices ?

Are you able to take control now ?

shamanec commented 6 months ago

Well I can't say for sure, but it doesn't hurt to try 😅 This worked on my Mac, but who knows, it might not work on yours.. Just change the ip address and dbpath based on your local setup and test it and let me know. We'll find a solution 😛

rajeshj93 commented 6 months ago

Sure, let me check it out in the morning and keep it updated here, thanks a lot for your extended & quick support...😊

Code-P6 commented 6 months ago

@rajeshj93 Able to take control of iOS device and perform actions with local MongoDB setup. But still logs are not rolling out and android stream is breaking upon launching.l

image

@shamanec Your help over here will be greatly appreciated..

shamanec commented 6 months ago

The logs tab is a dummy, I haven't implemented that yet and it will be removed on next PR until I actually implement it :D You can find the device logs in the provider repo folder > logs > device_UDID folder. Also I can see the stream working, do you mean the control breaks? There is a Appium session timeout set on 60 seconds, so if you stay at a device control page for more than 60 seconds without doing anything - the session will expire and require you to go back and re-use the device - at some point I'll implement a button to refresh when this happens instead of going back to devices list :P If you see that popup when initially opening a device control page - then that is an actual bug or something is wrong with the Appium session we use for control :( Examine the device/provider logs or provide additional information based on my response and hopefully we will fix it :)

shamanec commented 6 months ago

Hmmm, that is weird, I don't believe I've seen such an error. But this is the terminal output. I mean the provider.log file in the logs folder - the logs are only stored in files and in MongoDB, there is almost zero useful logs output in the terminal. Also in the logs folder you can find additional folders like device_5fd7c49d - this is where each device log is stored(as well as in MongoDB). Also you can run the provider with --log_level=debug to get even more output in those log files(if you are not using the flag already). Also have you installed uiautomator2 Appium driver?

shamanec commented 6 months ago

If you guys find me on Discord you can share your screen and do a live debug or remote session or whatever - shamanec (or drunkencheetah but I think its the first one) :)

rajeshj93 commented 6 months ago

In provider.log, We are able to see gads is installed into the particular android device. When we try to open the app in mobile, casting get started. And we are not seeing logs getting captured post that in provider.log file im the logs folder.

uiautomator2 installed ? --> YES, Its installed log_level=debug added ? --> Yes added to capture more detailed log

@shamanec we tried to connect your discord but not able to join

shamanec commented 6 months ago

Yes, I can see that the stream is working on the screenshot you provided - I am trying to understand why interaction doesn't work. If there are no more logs in the provider.log then the device should have been set up successfully and its not doing anything else. Maybe there is something in the device logs in their respective folder? It should output Appium logs and some other stuff as well so there might be a valid error there

rajeshj93 commented 6 months ago

Sure, i will add the log im the morning to have it checked..

shamanec commented 6 months ago

It seems there is no Appium session created - it calls /session//actions and the session ID is missing. I also saw multiple times the errors:

{"event":"appium","level":"debug","msg":"2024-01-11 06:43:22:925 - \u001b[35m[Appium]\u001b[39m Something went wrong installing the "sharp" module","time":"2024-01-11T12:13:22+05:30"}
{"event":"appium","level":"debug","msg":"2024-01-11 06:51:42:677 - \u001b[38;5;16m[AppiumDriver@64e2]\u001b[0m Encountered internal error running command: Error: Could not find a driver for automationName 'UiAutomator2' and platformName 'Android'. Have you installed a driver that supports those capabilities? Run 'appium driver list --installed' to see. (Lower-level error:","time":"2024-01-11T12:21:42+05:30"}

Which node version do you use? How was it installed? It should find the uiautomator2 driver if Appium is installed as expected.. Maybe try and join here

shamanec commented 5 months ago

That problem was fixed so closing issue