Auto Generate Runner File in Cucumber

Auto Generate Runner File in Cucumber
As we all are aware Runner file is the heart of any cucumber project so creating it every time manually corresponding to each feature file is going to be a cumbersome task. 

Let’s imagine a scenario where we have 100 feature file present in our project and every time we need to create corresponding runner file to execute that feature file is going to take a huge amount of testing effort.

To solve all this issue one of the solutions is Auto Generating cucumber Runner file using cucumber-Jvm-Parallel-Plugin.To More know about this plugin please click here.

Before going into the implementation part let’s look into my project structure

To Implement auto-generate Cucumber file we need to follow the below steps:

1)     Inside our POM.xml file, we need to add Cucumber-JVM-Parallel Plugin.

2)     In that inside execution id and goal should be generateRunner.

3)     Rest all fields are very much self-explanatory I have also put a comment in the plugin section as well.

4)     Now once we execute our POM.Xml file we will see that automatically all our runner files are generated corresponding to feature file defined in Cucumber JVM parallel Plugin.

In this case, 4 Runner Files are auto-generated corresponding to my 4 feature files.



My Name is Ankur Jain and I am currently working as Automation Test Architect.I am ISTQB Certified Test Manager,Certified UI Path RPA Developer as well as Certified Scrum Master with total 12 years of working experience with lot of big banking clients around the globe.I love to Design Automation Testing Frameworks with Selenium,Appium,Protractor,Cucumber,Rest-Assured, Katalon Studio and currently exploring lot in Dev-OPS as well. I am currently staying in Mumbai, Maharashtra. Please Connect with me through Contact Us page of this website.

Previous Post
Next Post
December 22, 2019 at 2:37 PM

Nice implementation ..Thanks

April 23, 2020 at 5:29 PM

Thanks Ankur!

Can we achieve in normal BDD Cucumber Java project by adding Cucumber JVM Parallel Plugin Maven Plugin external jar?

If yes do we need to any setting to achieve this?

Could you please help me on this.

April 25, 2020 at 1:07 AM

Thank you for this valuable information. Can you tell me how can we use Allure Report with junit in cucumber .plz

May 14, 2020 at 5:54 PM

How to work with cucumber 4.0 with the plugins

because it imports Runwith from cucumber.api whereas in 4.0 we have imports from import io.cucumber.junit.Cucumber;