package com.mridul.framework.selenium.pages;
import com.mridul.framework.selenium.interfaces.AbstractContainer;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
/**
* Created by Mridul on 3/10/2016.
*/
public abstract class AbstractPage extends AbstractContainer {
public AbstractPage(WebDriver driver){
super(driver);
}
protected void getURL(String url){
driver.manage().window().maximize();
driver.get(url);
////TODO-format into separate code sometime
wait.until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver webDriver) {
return ((JavascriptExecutor) driver).executeScript(
"return document.readyState"
).equals("complete");
}
});
driver.switchTo().defaultContent();
//invoking validate anchors
validateAnchors();
}
public String getCurrentURL(){
return driver.getCurrentUrl();
}
public void closePage(){
driver.quit();
}
}
Friday, August 5, 2016
AbstractPage
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment