-
-
Save fdama/29eb5d8338c5a369457c6405dd183511 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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