UiParts { @SuppressWarnings("unchecked") public static <T extends UiPart> T get(Class<T> part) { return (T) Proxy.newProxyInstance(part.getClassLoader(), new Class[]{part}, new UiPartProxy(part)); }  @SuppressWarnings("unchecked") static T get(Class<T> part); static T on(Class<T> uiPart); @SuppressWarnings({"rawtypes", "unchecked"}) static Predicate<WebElement> visible(); static Function<SearchContext, WebElement> visible(final org.openqa.selenium.By by); static Function<SearchContext, WebElement> anyVisible(final org.openqa.selenium.By... bys); static Function<SearchContext, List<WebElement>> allVisible(final org.openqa.selenium.By by, final int minimumSize); static org.openqa.selenium.By toSeleniumBy(By locator); static org.openqa.selenium.By buildBy(Method method); static org.openqa.selenium.By buildBy(Class<? extends UiPart> view); static org.openqa.selenium.By transform(FindBy locator); static org.openqa.selenium.By transform(org.openqa.selenium.support.FindBy locator); static org.openqa.selenium.By transform(org.openqa.selenium.support.FindAll locator); @SuppressWarnings({"unchecked", "rawtypes"}) static Predicate<WebElement> withText(final String text); static List<org.openqa.selenium.By> globals(); static Head head(); static Body body(); @SafeVarargs static T getFirstVisible(final Class<? extends UiPart>... parts); static boolean isEmpty(WebElement element); static boolean isEmpty(WrapsElement element); static boolean isEmpty(Iterable<?> elements); static long DEFAULT_DELAY; }
@Test public void lame() { WebDriver driver = DriverFactory.getDriver(); driver.get("http: String html = driver.getPageSource(); driver.findElement(org.openqa.selenium.By.name("q")).sendKeys("automationrockstars\n"); WebElement d = new FluentWait<SearchContext>(driver) .withTimeout(5, TimeUnit.SECONDS) .until(new Function<SearchContext, WebElement>() { @Nullable @Override public WebElement apply(@Nullable SearchContext searchContext) { return searchContext.findElement(org.openqa.selenium.By.className("g")); } }); DriverFactory.closeDriver(); }