Hello! I got parallel nodes working on my local Mac with Selenium Grid. I’m using TestNG, and have two Android Drivers created with the correct capabilities configurations. (At this point I’ve tried one hub as well as two hubs) I’m stuck because one test starts to work, and then the moment the other test comes up on the second emulator (two emulators!), the first test stops because the second one does this:
info: [debug] Attempting to kill all ‘uiautomator’ processes
info: [debug] Getting all processes with ‘uiautomator’
Is it just not possible for two android emulators to be running tests at the same time locally?
How are you telling your Appium nodes which emulator to use? I use one of the two options below to tell Appium which device to use when I’m running in parallel on a machine with multiple devices:
Start Appium nodes using the --default-capabilities flag with an argument of ‘{“udid”:“Emulator_ID_goes_here”}’. When I start a driver session on Appium with this default capability set, Appium will try to use the specified emulator (or device) when running the test.
Pass in the “udid” capability for each test that sets up its own driver.
If you’re not specifying these options, then each of your Appium instances will pick a device to work on. You should not know which device they will pick, and there’s no easy way to figure out which device will be picked. In this case, they are likely to pick the same device and cause conflicts with each other.
Yeah I do use the flag/argument, id being e.g. emulator-5554 <- this is the id correct?
So you are able to fire up more than one emulator? Are you using Selenium Grid? Because I’m using selenium grid and each thread fires up its own unique AndroidDriver, communicates with the nodes correctly, starting up the app in the emulator, but I fail when the command to start uiautomatorviewer is called (I think…)
My setup is slightly different; I use real devices instead of emulators, but I see no reason why using emulators would not work. What is the exact command you are using to start your Appium nodes?
I have some redundancy, but it’s not an issue getting everything up and running in single thread. Emulators respond just fine to commands installing apk, etc., so the nodes are configured properly I believe.
Yeah, same issue I’m going to try it with real devices to see if I can reproduce the issue and go from there. Thanks so much, afwang, i’ll keep you posted!
Hmm… pretty strange. I tried reproducing the behavior here, but I’m running into a separate problem where my emulators are too slow. All I can recommend now is to make sure your Android SDK tools are up-to-date.