Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

Parameterization without Example Keyword

Category: BDD Cucumber

Feature: Login Action

Scenario: Successful Login with Valid Credentials
Given User is on Home Page
When User Navigate to LogIn Page
And User enters “testuser_1” and “Test@123”

Then Message displayed Login Successfully

---------------------------------------------------------------------------
@When("^User enters \"(.*)\" and \"(.*)\"$")

public void user_enters_UserName_and_Password(String username, String password) throws Throwable {
driver.findElement(By.id("log")).sendKeys(username);
driver.findElement(By.id("pwd")).sendKeys(password);
driver.findElement(By.id("login")).click();
}
-----------------------------------------------------------------------------
@When(“^User enters \”([^\”]*)\” and \”([^\”]*)\”$”)

Leave a Reply

Your email address will not be published. Required fields are marked *