Cucumber Appium Mobile Parallel Tests

I have a couple of test cases that I want to run in parallel. I have seen multiple documentations and tutorials but none work well with my setup. I’m using Cucumber Appium with TestNG, so I have feature files tagged with an annotation and their step definitions. However, I run the test case I need in the cloud service using Maven CLI, I do not use testNG.xml or anything special. How can I specify the Mobile Device + Cucumber tag that I want to run in parallel?

Example 1:
I want to run the same tag with two different mobile devices.

Example 2:
I want to run tag A with Mobile Device B, and run another test case with tag C and Mobile Device D.

Any help or link would be really helpful.
Thank you

To run the job with tags is easy, I’m sure you can already give something like:

<command> --tags <tags>

Or however you are doing it.

The trick would be specifying the device. For that you would have to overwrite the capabilities, or provide the different capabilities with the --default-capabilities flag and a json argument:

Changing the capabilities at runtime should provide you the flexibility that you are looking for. Once you’ve set capabilities to the proper device, giving the cucumber tag should be very simple.

1 Like

Hi @wreed,
Thank you for your answers. Regarding the second one, what approach would you advice to run the parallel test and feed the automation the data of the device?
For reference, is there a JSON, properties or YAML approach to feed it the data? In theory I can see it work as a properties file that would determine the mobile devices that need to run this test with their capabilities (device platform, os version …)

Given what you’ve told me I would try to write a Maven task for each test run. The task would read the JSON/YAML/Properties file and also include the tags that you want to run. My automation is written in Ruby, so my Maven knowledge could be a little suspect, but I believe this is the approach I would take. I don’t think it matters too much whether you use JSON/YAML/Properties file, whatever you are currently using can be adapted, and I’m fairly pragmatic when it comes to issues like this. Go with what you know.

1 Like