package pages.webelements; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class FramesAndWindowsPage { @FindBy(xpath = "//button[contains(text(),'Frames and Windows')]") private WebElement accordionItem; @FindBy(id = "custom-iframe") private WebElement frame; @FindBy(id = "new-window-button") private WebElement newWindowButton; private WebDriver driver = null; public FramesAndWindowsPage(WebDriver driver) { this.driver = driver; PageFactory.initElements(this.driver, this); } public void clickOnAccordionItem() { accordionItem.click(); } public WebElement frame() { return frame; } public void clickNewWindowButton() { newWindowButton.click(); } }