Package org.qagile.selenium

Source Code of org.qagile.selenium.SeleniumHelper

package org.qagile.selenium;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.qagile.conditions.ElementIsFound;
import org.qagile.support.Timer;

public class SeleniumHelper {

  private WebDriver driver;

  public SeleniumHelper() {
    this.setDriver(SeleniumProvider.getDriver());
  }

  public WebDriver getDriver() {
    return driver;
  }

  public void setDriver(WebDriver driver) {
    this.driver = driver;
  }

  public void openUrl(String url) {
    driver.get(url);
  }

  public WebElement findElement(By element) {
    new Timer(5000).waitUntil(new ElementIsFound(element));
    return driver.findElement(element);
  }

  public String getTitle() {
    return driver.getTitle();
  }
 
 
 

}
TOP

Related Classes of org.qagile.selenium.SeleniumHelper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.