Welcome to the Question and Answer site for Software Testing Professionals

You can get your queries resolved from Software Testing Professionals.

Ask a Question

Get answers and give answers to questions from other members.

View All Questions

Get votes and earn points to build your reputation in community.

View Hot Questions

how can we trigger cucumber java runner file from cmd line?

Open 1 Answers 19 Views
0 1

I have written a automated test sute using Java Cucumber. Can you tell me how can we trigger cucumber java runner file from cmd line? I am neither using maven nor ant?

I can use JUnit runner.

1 Answer


You can run the test the same way you would run a JUnit test on the command line:

java -cp <classpath> org.junit.runner.JUnitCore com.example.test.RunCukesTest

where RunCukesTest is the unit test that sets all the cucumber options, e.g.:

package com.example.test;

import org.junit.runner.RunWith;

import cucumber.api.junit.Cucumber;
import cucumber.api.CucumberOptions;

@CucumberOptions(plugin = "json:target/report.json")
public class RunCukesTest {

<classpath> is where you can mention your JAR files.

If all your JAR files are inside lib folder, your command can be:

java -cp "lib/*" org.junit.runner.JUnitCore com.example.test.RunCukesTest


answered by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

We have resolved 1.2k+ Software Testing queries!

Software Testing Board Weekly update

We will send you handpicked questions that you would love to answer.

View previous campaigns.

Top Contributors