public PageBase(WebDriver driver) { if(driver == null) throw new IllegalArgumentException("Driver object is null"); PageFactory.initElements(new AjaxElementLocatorFactory(driver, 10), this); this.driver = driver; }
private static FieldDecorator initDecorator(SearchContext searchContext, Field field) { FieldDecorator decorator; AjaxElement ajaxElementAnnotation = field.getAnnotation(AjaxElement.class); if (ajaxElementAnnotation != null) { int timeout = ajaxElementAnnotation.timeOutInSeconds(); decorator = new WiseDecorator(new AjaxElementLocatorFactory(searchContext, timeout)); } else { decorator = new WiseDecorator(new DefaultElementLocatorFactory(searchContext)); } return decorator; }
protected BasePage(WebDriver driver) { this.driver = driver; LOGGER.info("Navigating to [{}]...", this.getClass().getSimpleName()); PageFactory.initElements(new AjaxElementLocatorFactory(driver, TimeoutValue), this); }
public String clickOnNewDatasourceAction() { mainPage.getMainMenuAction("Datasource/New Datasource Connection").click(); newDatasourceWizard = new NewDatasourceWizardPage(driver); PageFactory.initElements(new AjaxElementLocatorFactory(driver, 15), newDatasourceWizard); return "clicks"; }