Create a feature file for the registration form using Data Tables in Cucumber to input multiple fields: name, email, password, and confirmation password. Implement step definitions to read data from the Data Table and interact with the web page.
Feature: User Registration
Scenario: Register a new user
Given I am on the registration page
When I register with the following details
| Field | Value |
| Name | John Doe |
| Email | john@gmail.com |
| Password | Pass1234 |
| ConfirmPassword | Pass1234 |
Then I should be registered successfully
package cucumber;
import java.util.List;
import java.util.Map;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.cucumber.datatable.DataTable;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
public class CucumberEx4{
WebDriver driver = new ChromeDriver();
@Given("I am on the registration page")
public void i_am_on_the_registration_page() {
driver.navigate().to("https://www.example.com/registration");
}
@When("I register with the following details")
public void i_register_with_the_following_details(DataTable dataTable) {
List
Copyright © 2023 - Proleed Academy | All Rights Reserved.