Esempio n. 1
0
 /**
  * Verifies if an element is visible. Continue with tests even if false.
  *
  * @param expression boolean expression to evaluate
  * @param msg message to log on failure
  */
 public void waitForVisible(WebElement elementToBeVisible) {
   Checks.notNull("elementToBeVisible", elementToBeVisible);
   try {
     wait.until(ExpectedConditions.visibilityOf(elementToBeVisible));
   } catch (Exception e) {
     Exceptions.chuck(e);
   }
 }
Esempio n. 2
0
 /**
  * Instantiate an object,using Selenium's PageFactory, and injecting any fields annotated with
  * @Inject by Guice.
  *
  * <p>This is useful if you have caused the browser page to refresh and you need to rebuild a
  * model of the window's page.
  *
  * @param <T> A type
  * @param type The object to create
  * @return A new instance of this type
  */
 public <T> T instantiate(Class<T> type) {
   Checks.notNull("type", type);
   T result = PageFactory.initElements(driver, type);
   deps.injectMembers(result);
   return result;
 }