How to run test in Parallel with Cucumber and JUnit

Can Some one give a Example how to run test in Parallel with Cucumber and JUnit?

My problem is that after the Second Test has started the First Test Lost his driver

How can i set a Device for TestA and a different Device for TestB?

What port do i have to use for the Second appium server?

Hi Felix,

There is no need to pickup two appium servers,
you just use the same port (that’s something nice about appium studio)

from my experience, these issues usually occur due to parallel framework implementation (e.g you have one static driver,or synchronized methods between two parallel tests)

Cucumber & JUnit configuration is tricky for parallel execution

My recommendation :

achieve parallelism by executing two separate Cucumber processes, e.g by running a batch file or shell script

using the batch or shell, pass the device \ os \ suite parameters to the cucumber process

I hope this makes sense, if you have more details you want to discuss, feel free

Hi Tom,

Thanks for your help.

The solution was to make the driver non-static

For Cucumber Parallel execution i can recommend


1 Like

Great Felix,

Thanks for sharing :slight_smile:

Based on the first item, I’ll re-iterate my previous comment -
My experience with Cucumber and JUnit, it’s much easier to achieve parallelism by forking rather than threading

If your parallel pool is less than 10 executions, usually a single machine will suffice, and forking makes debugging \ maintenance easier in the future

Best of luck moving forward!

@Felix - If you have achieved this parallel execution using cucumber junit for mobile application, could you please share the solution with me?