Hello,
I try to execute test on 2 real android phones on parallel, registered on the grid and plugged on the same machine, but all tests are running on the same device because appium always start test on the first device it finds.
I’ve set my 2 phones in a json file, with different ports. and I’ve launch 2 instances of Appium, like that:
command line : appium --relaxed-security --nodeconfig /path/to/nodes_4727_GalaxyS7.json -p 4727 --session-override -bp 4727
the json : https://gist.github.com/ericzered/1384671a334cc0f471636cf6f3aeb2d7
Purpose is that, when I run my test with capabilities “browserName: ‘chrome’ maxInstances: 2” (but no specify an udid), half of the tests run on device #1 on the grid and other half on the device #2, but no, the 2 Appium launch them on the same device. I wish Appium can use the udid it’s got in his json file to dispatch.
Because I’ve put the udid of the first phone in my first Appium instance, why can’t it run the test only on this device ?
Is there a way to lock an Appium instance on a specific android device ? So each session will not go on the same device ?
Thanks a lot
@zered Appium does not care about any parallel problem. it is just a proxy between your code and device. all magic to start and open multiple drivers in your code. you did not mention what is inside your code, what you use to make it parallel. Appium itself can not manage parallel run.
e.g. you can use Java+TestNG with parallel option by method or Javascript/TypeScript + Jasmine with parallel out of the box.
I actually locked each appium process to the phone in test with arguments that seemed to work for selenium-grid. This way the instance is directly linked to the udid in the node config file and the process is specificaly told to use that udid phone.
Thanks @bennid ! It looks better now, I’ve tried to put the udid and other args like you in command line and I see that each appium focus on the dedicated device like it should.
I see too that in certain cases, an appium session can manage the “wrong” device (as example when I launch a job for a specific device and the session who supposed to deal with this device is busy).
So I have to be careful with that but it’s a big step forward, thanks !
Yeah… with the hub you can set it to throw if there is currently no match (instead of just picking one). We also have a custom Matcher and Proxy to handle extra capability support like phone brand, and specific model number.