I have created a login test script and verified home page also but now I have to add new customer and the form accepts following values
- Customer Name
- Gender
- Date Of Birth
- Customer Address , city, State and Pin
- Customer Mobile No
- Customer Email ID and Password.
Following code I have implemented
{
WebDriver driver;
@FindBy(name = "name") WebElement CustomerName;
@FindBy(xpath = "//input[@value='m']") WebElement Gender;
@FindBy(name = "dob") WebElement DateOfBirth;
@FindBy(name="addr") WebElement CustomerAddress;
@FindBy(name = "city") WebElement CustomerCity;
@FindBy(name="state") WebElement CustomerState;
@FindBy(name="pinno") WebElement CustomerPin;
@FindBy(name="telephoneno") WebElement CustomerMobileNo;
@FindBy(name="emailid") WebElement CustomerEmailId;
@FindBy(name="password") WebElement CustomerPassword;
@FindBy(name="sub") WebElement FormSubmitBtn;
//Created Constructor of the Class Guru99_AddNewCustomer
public Guru99_AddNewCustomer(WebDriver driver)
{
this.driver = driver;
PageFactory.initElements(driver, this);
}
public void CustomerName( )
{
CustomerName.sendKeys();
}
}
but passing values via send keys and passing parameters in method will make my code too long and bulky, I just need to pass sheet Name as we do in Data Driven Framework so that data I'm passing will automatically get filled.
Any assistance will be helpful
Above elements can be found on http://demo.guru99.com/V4