How can I run TestSuites in parallel from xml documents

I’m trying this, but it just runs the test sequentially

!DOCTYPE suite SYSTEM “http://testng.org/testng-1.0.dtd”>
suite name=“AllSuites” verbose=“1” parallel =“tests” thread-count=“10”>
suite-files>
suite-file path=“TestSuites/AllSuiteTest1.xml”>
suite-file path=“TestSuites/AllSuiteTest2.xml”>
/suite-files>
/suite>–>

My ultimate goal is to kick off my IOS test and Android test in parallel.

Thank for any information you can provide.

DD

Hi @dduphorn

Can you give a try with Maven-surefire-plugin?
http://maven.apache.org/surefire/maven-surefire-plugin/examples/testng.html

===
TestNG 6.9.8 (JRE 1.7) and plugin version 2.19 or higher allows you to run suites in parallel.

Have a look at below reference,

By the way, we are using TestNG version 6.8.7 and Java 1.7/1.8.

Regards,
Bhaskar.

I did figure it out, and below is how I did it.

I will however take a look at the information you provided.

Thanks

!DOCTYPE suite SYSTEM “http://testng.org/testng-1.0.dtd”>
suite name=“RunAllTestSuitesInParallel-SG” verbose=“1” parallel =“tests” thread-count=“10”>
test name = "ANDROID_Tests”>
parameter name=“AP1” value=“AP1Value”>
classes>
class name=“AutomationCode.TestCases”>
methods>
include name=“Android-Test1” />
include name=“Androit-Test2” />
/methods>
/class>
/classes>
/test>
test name = "IOS_Tests”>
parameter name=“IP1” value=“IP1”>
classes>
class name=“AutomationCode.TestCases”>
methods>
include name="IOS_Test1” />
include name="IOS_Test2” />
/methods>
/class>
/classes>
/test>
/suite>

One question: Have you defined your appium driver object as static?

@Mayuresh_Shirodkar I’m not sure what you mean, but I didn’t do anything special to my Appium Driver.

My tests are executing on different AppiumPorts and use different BootstrapPorts

What i mean is how do you define is it like below or you do not use static driver and instead create objects:
static Appium driver;
driver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”), dc);

Why i ask you this is when there is a static definition of any element, Parallel Testing doesnt work.Need you to confirm

For every test I’m specifying a separate AppiumPort.

I the example below I replace 4723 with a different port value per test.

driver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”), dc);

Does that make sense?

DD

Yes i understand the part where you use different port for each device you test your script on.
As i have already tried that, and was able to execute the scripts in parallel,But had a issue wherein the script continued on one of the devices and other device stopped.

I probably feel it may be due to the static driver object.

Could you please post your driver definition snippet here, if you dont mind?

1 Like

How are you stopping the appium server? My guess is that you are killing all nodes, and you need to be killing the node tied to the appium port.