Skip to content

Instantly share code, notes, and snippets.

@fdama
Created January 9, 2023 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fdama/29eb5d8338c5a369457c6405dd183511 to your computer and use it in GitHub Desktop.
Save fdama/29eb5d8338c5a369457c6405dd183511 to your computer and use it in GitHub Desktop.
package com.internetBanking.pageObjects;
import java.time.Duration;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.CacheLookup;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;
import org.openqa.selenium.support.PageFactory;
public class EditCustomerPage {
WebDriver driver;
public EditCustomerPage(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
}
@FindBy(how = How.XPATH, using = "//a[contains(text(),'Edit Customer')]")
@CacheLookup
WebElement lnkEditCustomer;
public void clickEditCustomer() {
lnkEditCustomer.click();
}
@FindBy(how = How.NAME, using = "cusid")
@CacheLookup
WebElement txtCustomerID;
public void setCustomerID(String customerId) {
txtCustomerID.sendKeys(customerId);
}
@FindBy(how = How.NAME, using = "AccSubmit")
@CacheLookup
WebElement btnSubmit;
public void submit() {
btnSubmit.click();
}
@FindBy(how = How.NAME, using = "city")
@CacheLookup
WebElement txtCity;
public void custCity(String city) {
txtCity.sendKeys(city);
}
public String getCustCity() {
return txtCity.getText();
}
@FindBy(how = How.NAME, using = "state")
@CacheLookup
WebElement txtState;
public void custState(String state) {
txtState.sendKeys(state);
}
public String getCustState() {
return txtState.getText();
}
@FindBy(how = How.NAME, using = "sub")
@CacheLookup
WebElement btnSubmitForm;
public void submitForm() {
btnSubmitForm.click();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment