Example usage for org.openqa.selenium.support.pagefactory AjaxElementLocator AjaxElementLocator

List of usage examples for org.openqa.selenium.support.pagefactory AjaxElementLocator AjaxElementLocator

Introduction

In this page you can find the example usage for org.openqa.selenium.support.pagefactory AjaxElementLocator AjaxElementLocator.

Prototype

public AjaxElementLocator(SearchContext searchContext, Field field, int timeOutInSeconds) 

Source Link

Document

Main constructor.

Usage

From source file:com.github.licanhua.test.framework.base.CustomElementLocatorFactory.java

License:Apache License

private ElementLocator createLocator(SearchContext searchContext, Field field) {
    ElementContext context = parent.getElementContext();
    if (context.isAjax()) {
        logger.debug("AjaxElementLocator is created for " + field.getName()
                + " with AjaxTimeoutInSeconds setting: " + context.getAjaxTimeoutInSeconds());
        return new AjaxElementLocator(searchContext, field, context.getAjaxTimeoutInSeconds());
    } else {/*from   w  w  w .j av  a  2 s . c  om*/
        logger.debug("DefaultElementLocator is created for " + field.getName());
        return new DefaultElementLocator(searchContext, field);
    }
}

From source file:com.surevine.alfresco.space.webdriver.DocumentLibraryPage.java

License:Open Source License

public WebElement getDocumentLink(String string) {
    Field f = null;/*from w  ww  .ja  v  a 2 s  .  c  o  m*/
    try {
        f = DocumentLibraryPage.class.getDeclaredField("docLink");
    } catch (SecurityException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (NoSuchFieldException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    AjaxElementLocator ael = new AjaxElementLocator(driver, f, 15);

    return (ael.findElement());
}

From source file:org.nuxeo.functionaltests.VariableElementLocatorFactory.java

License:Open Source License

@Override
public ElementLocator createLocator(Field field) {
    if (field.getAnnotation(SlowLoading.class) != null) {
        return new AjaxElementLocator(driver, field, timeOutInSeconds);
    } else {/*from ww  w.  j  av a  2 s .c  om*/
        return new DefaultElementLocator(driver, field);
    }
}