Java tutorial
package CertMaven.pageObjects; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; public class DriverPage extends GeneralPage { public DriverPage(WebDriver driver) { super(driver); } public DriverPage enterDetails() throws InterruptedException { driver.findElement(By.xpath("//input[@class='rf-cal-inp empty-or-date ']")).clear(); Thread.sleep(2000); driver.findElement(By.xpath("//input[@class='rf-cal-inp empty-or-date ']")).click(); Thread.sleep(2000); driver.findElement(By.xpath("//input[@class='rf-cal-inp empty-or-date ']")).sendKeys("02/18/1956"); driver.findElement(By.xpath("//input[@class='valid']")).clear(); driver.findElement(By.xpath("//input[@class='valid']")).sendKeys("B13848967"); driver.findElement( By.xpath("//input[@id='policyDataGatherForm:driverMVOInformation_driver_firstLicenseAge']")) .clear(); driver.findElement( By.xpath("//input[@id='policyDataGatherForm:driverMVOInformation_driver_firstLicenseAge']")) .sendKeys("22"); return new DriverPage(driver); } public DriverReportsPage DriverPageClickContinueButton() throws Throwable { waitWhileAjaxCompletesUptoAMinute(); //waitTillVisible("policyDataGatherForm:next"); driver.findElement(By.id("policyDataGatherForm:next")).click(); return new DriverReportsPage(driver); } public DriverReportsPage ClickContinueButtonInquiry() throws Throwable { try { driver.findElement(By.id("policyDataGatherForm:nextInquiry")).click(); } catch (Exception e) { Thread.sleep(2000); driver.findElement(By.id("policyDataGatherForm:nextInquiry")).click(); } return new DriverReportsPage(driver); } }