1
votes

I am using TestRunner class which extends AbstractTestNGCucumberTests to run cucumber feature files in Testng. I have a Issue in the last step where I am using ApprovalTests to verify the response I get from database. I am seeing an exception

"com.spun.util.FormattedException: Didn't find cucumber.api.testng.AbstractTestNGCucumberTests under C:\Users\nsyed\Awris2\LearnDatabase"

Does anyone know why is this exception coming?? My Runner class is:

@CucumberOptions(features = {"src/test/java/Features/ValidateStagingDB.feature"}
,glue={"StepDefinition"}
,dryRun=false
,strict=true
,public class TestRunner extends AbstractTestNGCucumberTests{}`

And Exceptions is here at Approvals.VerifyAsJso

@Then("^the response should match the golden copy$") public void the_response_should_match_the_golden_copy() throws Throwable {

    try {

        Approvals.verifyAsJson(DbHelper2.getJsonRepresentationFor(TableData));
    }
    catch(Exception e) {
        System.err.println(e);
    }
    finally {
        System.out.println("Closing the database connection");
        connection.close();
    }
1

1 Answers

0
votes

Can you try to include the cucumber-jvm.jar in your path folder. Here is the location to download: https://mvnrepository.com/artifact/info.cukes/cucumber-jvm

If you maven based project please add this dependency.

If the issue is not fixed, can you try pasting the cucumber-jvm in the path which is shown in the error message. That way we will be sure that it is the missing binaries in the path. If the succeeds you have to figure out the right path where all you jars should go in.