Package org.qagile.conditions

Source Code of org.qagile.conditions.ElementIsFound

package org.qagile.conditions;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.qagile.selenium.SeleniumHelper;

public class ElementIsFound implements Condition {
  private By locator;
  private WebDriver driver;
  public ElementIsFound(By locator) {
    this.locator = locator;
    this.driver = new SeleniumHelper().getDriver();
       
  }

  public boolean isSatisfied() {
    try {
      driver.findElement(locator);
     
    } catch (Exception e) {
      return false;
    }
    return true;
  }

  public String describe() {
    // TODO Auto-generated method stub
    return "Waiting for element" + locator.toString();
  }

}
TOP

Related Classes of org.qagile.conditions.ElementIsFound

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.