Concurrent Multiple Phone

I may need tests that have 2+ phones interacting with one another. Can I do that with Appium Studio ?

thanks

Appium Studio Community Edition supports the execution of exactly 2 parallel devices

you can create two drivers - each one paired to a phone and run the tests in parallel, or control two devices from the same test

the devices can be of any OS mixture

Thanks Tom ! look forward to giving this a whirl.

1 Like

Hi Tom,

I am trying to run my one test class on 2 iOS devices parallel .

How to run?
How to create 2 drivers and pair to phone ?

Could you please help on this.

Thanks in advance.

@sudhakar

You can use TestNG which has a really good implementation of parallel testing:

You can find more information in the links below:

I am looking with Appium studio .

In appium studio there only one port which can assign to one driver

How to create 2 nodes ?

Required help on this.

Hi,

To run concurrent tests on more than one device, you will have to export your code to your IDE.

https://docs.experitest.com/display/AS/Code+export+your+script

Once you export the test class, use TestNG to run the class in parallel on the two devices.

Hi
I tried parallel execution through TestNG ,but still facing below issue .
I have 2 iPhones connected , when i am trying to run test parallel through testng xml . it sometime test is running on correct device but sometime it is getting confuse and tries to execute test on unexpected device,is there any solution to point test on specific device

It runs first available device and leaves other device and it fails

any help would be appreciate

Hi @sudhakar

How did you configure your testng.xml and test classes?

Try the following:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite" parallel="tests" thread-count="2">

<test name="iPhone1">
    <classes>
        <class name="<YOURTESTCLASS>" />
    </classes>
</test>

<test name="iPhone2">
    <classes>
        <class name="YOURTESTCLASS" />
    </classes>
</test>

In the @Before section of you java test file, specify the capability:

dc.setCapability(MobileCapabilityType.PLATFORM, "ios");

Instead of the device UDID.

What would happen is that TestNG would create two instances of the test class where each of them would try to fetch an iOS device (any that is available), effectively running the test in parallel on both devices.

Let us know how it goes.

Hi Nivi,

Thanks for Help.

I used testng.xml with above mentioned code.

Able to launch app, but when it performing actions or Send keys to mobile , it is taking the device which is available and other device goes is non sync.

I can see port pickup is not in sync, due to that execution goes non sync.

Not working.

Could you please help us on this.

Thanks in advance.

Hi @sudhakar

If I understand you correctly, you are trying to run the test on a specific device, not just any iOS device.

If so, you can use TestNG parameters to pass the device UDID:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="Suite" parallel="tests" thread-count="2">

    <test name="iPhone1">
        <parameter name="udid" value="UDID1"/>
        <classes>
            <class name="YOURTESTCLASS" />
        </classes>
    </test>

    <test name="iPhone2">
        <parameter name="udid" value="UDID2"/>
        <classes>
            <class name="YOURTESTCLASS" />
        </classes>
    </test>

</suite>

To fetch the passed udid, in your code pass the parameter to the @BeforeMethod method:

 @BeforeMethod
 @Parameters("udid")
    public void setUp(String udid) {
        /*
        capabilities
       */
      dc.setCapability(MobileCapabilityType.UDID, udid);

Hi Nivi,

Something is better now , but still unluck.

Its not working. I can see again in non sync and getting failed .

Any other solution please.

Thanks in advance

what is the status of this issue ?

Hi Wakelt ,

its not working… I can see port takes which mobile is active and other leaves behind , due to that passing data to fields is in non syns , as ports are getting exchanged.

If any help on this would be appreciated .

Thanks in advance.
Sudhakar MK

i found new study https://www.welookups.com