What is Cucumber dry run in Selenium?

SeleniumAutomation TestingTesting Tools

Cucumber dry run is used for compilation of the Step Definition and Feature files and to verify the compilation errors. The value of dry run can be either true or false. The default value of dry run is false and it is a part of the Test Runner Class file.

In case the value of dry run is set to true, Cucumber will verify individual steps in the Feature file and the implementation code of steps in Feature file within the Step Definition file.

A message is thrown, if any of the steps in the Feature file is not implemented in the Step Definition file. A dry run parameter is a part of the @CucumberOptions which is used to configure the test settings.

Example

Implementation of Test Runner Class file

import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
   features = "Feature"
   ,glue={"stepDefinition"}
   ,strict = true
   ,dryRun = true
)
public class TestRunner {
}
raja
Published on 07-Apr-2021 12:51:27
Advertisements