简体   繁体   中英

How to use xml object repository for android parallel test execution

I am trying for Parallel Execution of My Selenium Test code on 2 Android devices . Object Repository - XML Device - Android Real device Appium version - 1.13 Java-client - 6.0.0

When running test in parallel mode , App launching on both device, after that when i am trying to access element , on 1st device able to access and test proceed , but in second device appium not able to find the elements. and test fail in 2nd device by saying not able to locate element .

if i run test as a single test , it pass on both device , but fail in parallel mode.

is there any issue of accessing element from xml in parallel mode .

please suggest how to use object repository in parallel mode

Most probably you haven't applied ThreadLocal Storage pattern to your AndroidDriver instances. You should be storing AndroidDriver under ThreadLocal something like:

ThreadLocal<AndroidDriver> driver = new ThreadLocal<>();
// initialize AndroidDriver normally
driver.set(new AndroidDriver(new URL("http://url-of-your-appium-server"),capabilities));

and whenever you need to refer the AndroidDriver - do it like:

driver.get().findElements....

More information:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM