Appium Parallel Execution

I am starting the appium server using the following code snippet and it works fine:

@BeforeTest
public void appstart() {
AppiumDriverLocalService service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder()
.usingDriverExecutable(new File("/Applications/Appium.app/Contents/Resources/node/bin/node"))
.withAppiumJS(new File("/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js"))
.withLogFile(new File("/Users/Desktop/logs.txt")));
service.start();
try {
//setting the capabilities
} catch (Exception e) {
e.printStackTrace();
}
}

Now I need to go on with parallel execution. If I use grid I need to create different nodeconfig.json files which includes the appium instance details. If I need to run my test in three device is it necessary to create three different nodeconfig.json files? Is it possible to use the same code snippet to start the appium for parallel execution, if so how?

http://blog.zymr.com/configuring-appium-node-servers-with-selenium-grid

@Durga_M,
As I promised at: Xpath issue in marshmallow

But we already had the shared link from @pavan_appium. Can you give a try?

@TuHuynh
I’l try and let u know

1 Like

I’m starting the grid and registering the appium instance in java code using the below snippet:

@BeforeSuite
public void startgrid() throws IOException, InterruptedException{
Runtime.getRuntime().exec(“java -jar /Users/dd/Selenium/selenium-server-standalone-2.53.1.jar -role hub http://127.0.0.1:4444/grid”);
Thread.sleep(50000);
Runtime.getRuntime().exec(“appium -a 127.0.0.1 -p 4723 --no-reset --bootstrap-port 4730 -U device111 --nodeconfig /Users/dd/workspace/SampleAutomation/jsonFiles/node_config_1.json”);
Runtime.getRuntime().exec(“appium -a 127.0.0.1 -p 4725 --no-reset --bootstrap-port 4730 -U device222 --nodeconfig /Users/dd/workspace/SampleAutomation/jsonFiles/node_config_3.json”);
Thread.sleep(50000);
}

The test runs as i expected, but i’m not able to see the appium logs. How to see the appium logs using the above snippet.

–log youDirectoryHERE/appium.log

1 Like

Thanks @TuHuynh …completed parallel execution by using grid by following the article shared by @pavan_appium.

1 Like

Thanks a lot @pavan_appium …completed parallel execution and it is working fine

Hi @pavan_appium, have you ever tried to run parallel testing for iOS by using Grid?
IF yes, please share me that. Much appreciate for any clues!

@TuHuynh
Without using grid how u have implemented the parallel execution . If possible can u share me that?

Ah, I just could do that for Android by starting multiple Appium server with different ports.
With iOS, I couldn’t.

Hi @TuHuynh,
Once the test is completed I need to send the emailable-report.html in TestNg to mail. Do you have any idea on this? If so please let me know

Have you ever used Jenkins? If yes, we have a built-in feature for that one.

First I need to do locally sending the report to mail… then i have to go to jenkins…

I haven’t done it before. There was a guy described some steps. I think you can get the idea behind.

Yes Durga I have done Parallel Executions using iOS devices

I am trying for android @pavan_appium

@TuHuynh I have done on iOS devices with Grid

@pavan_appium

Wow, you are genius man! How could you do that??

Could you possibly share me steps that you did or the reference sources?
Thank in advance!

What challanges you were facing while doing ios parallel automation. So atleast I can help you to troubleshoot