Selenium utility classes
The following code is for the BrowserUtils.java
, Global_VARS.java
, TestNG_ConsoleRunner.java
, and selenium.properties
classes:
BrowserUtils.java
The following code is for the BrowserUtils.java
class:
import org.openqa.selenium.*; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; /** * @author Carl Cocchiaro * * Browser Utility Class * */ public class BrowserUtils { /** * waitFor method to poll page title * * @param title * @param timer * @throws Exception */ public static void waitFor(String title, int timer) throws Exception { WebDriver driver = CreateDriver.getInstance().getDriver(); WebDriverWait exists = new WebDriverWait(driver, timer); exists.until(ExpectedConditions.refreshed( ExpectedConditions.titleContains(title))); } /** * waitForURL...