How to do single data parameterization without Examples in Cucumber?

CucumberSoftware TestingAutomation Testing

We can do single data parametrization without using Examples in Cucumber by passing the value directly in the feature file.

Example

Feature file.

Feature: Tutorialpoint Job page
Scenario: Tutorialpoint job page look and fee
Given Launch site https://www.tutorialspoint.com/about/about_careers.htm
Then Verify the tabs on the page

URL is directly passed in the Given statement in the feature file.

The step definition file should have the mapping of the Given statement.

Example

@Given (“^Launch site \"([^\"]*)\"$”)
public void launchJobsite(String url){
   System.out.println("url is : " + url);
}
@Then (“^Verify the tabs on the page"$”)
public void tabverification(){
   System.out.println("Tabs verified successfully);
}

@Given (“^Launch site \"([^\"]*)\"$”) passes the UR at the runtime.

raja
Published on 11-Jun-2020 16:50:17
Advertisements