package zacksolutions.pages; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import zacksolutions.base.Initialization; public class HomePage extends Initialization { //Using PageFactory Object Model we get our elemets @FindBy(id="message") WebElement message; @FindBy(css="button[type='submit']") WebElement button; @FindBy(css="tbody tr:nth-child(1) td:nth-child(1)") WebElement ConfirmText; //Initialization public HomePage(){ PageFactory.initElements(driver, this); } //Actions public void insertText() throws InterruptedException { test = extent.createTest("Test msg"); message.sendKeys("4 8 15 16 23 42"); button.click(); extent.flush(); } public String textConfirmation(){ return ConfirmText.getText(); } }