Search code examples
javajunitjvmcucumberappium

Cucumber JVM Junit Runner cucumber api does not exist


I use cucumber JVM with mobile automation tests and it works fine but I need to run to my runner classes from command line for build server. When I use the

javac -cp .;C:\V3\YemeksepetiAndroid.v3.Tests\AndroidV3\src\test\java\com\cucumber\AndroidV3\junit-4.11.jar Galaxy_S4_Runner.java

for run as you can see the screenshot (http://prntscr.com/9mrr1i
) it gives error. Anyone help me ? :)

This is my runner class

package com.cucumber.AndroidV3;

import org.junit.runner.RunWith;

import cucumber.api.junit.Cucumber;
import cucumber.api.CucumberOptions;
@RunWith(Cucumber.class)

@CucumberOptions(

format = { "pretty", "html:target/html/s4/" },

features = { "src/test/resource" }, tags = { "@s4" }

)

public class Galaxy_S4_Runner {

Solution

  • You need the two Cucumber jars (cucumber-java.jar and cucumber-core.jar) on your classpath along with junit-4.11.jar. You should be able to find them in a Maven repository.