|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.samplu.common.WebDriverUtil
public class WebDriverUtil
The goal of the WebDriverUtil class is to invert the dependencies on WebDriver from WebDriverLegacyITBase for reuse without having to extend WebDriverLegacyITBase. For the first example see waitFor
WebDriverLegacyITBase
Field Summary | |
---|---|
static int |
DEFAULT_IMPLICIT_WAIT_TIME
TODO apparent dup WebDriverITBase.DEFAULT_WAIT_SEC TODO parametrize for JVM Arg 30 Seconds |
static String |
PROXY_HOST_PROPERTY
local proxy used for running tests thru jmeter. |
static String |
REMOTE_DRIVER_SAUCELABS_PROPERTY
Set -Dremote.driver.saucelabs for running on saucelabs |
static String |
REMOTE_PUBLIC_CHROME
Set -Dremote.public.chrome= or WEBDRIVER_CHROME_DRIVER |
static int |
SETUP_URL_LOAD_WAIT_SECONDS
Time to wait for the URL used in setup to load. |
static int |
SHORT_IMPLICIT_WAIT_TIME
TODO introduce SHORT_IMPLICIT_WAIT_TIME with param in WebDriverITBase TODO parametrize for JVM Arg 1 Second |
static String |
WEBDRIVER_CHROME_DRIVER
Selenium's webdriver.chrome.driver parameter, you can set -Dwebdriver.chrome.driver= or Rice's REMOTE_PUBLIC_CHROME |
Constructor Summary | |
---|---|
WebDriverUtil()
|
Method Summary | |
---|---|
static void |
checkForIncidentReport(org.openqa.selenium.WebDriver driver,
String locator,
Failable failable,
String message)
|
static org.openqa.selenium.chrome.ChromeDriverService |
chromeDriverCreateCheck()
|
static String |
deLinespace(String contents)
|
static String |
determineUser(String testParam)
|
static void |
failOnMatchedJira(String contents,
Failable failable)
|
static org.openqa.selenium.WebDriver |
getWebDriver()
remote.public.driver set to chrome or firefox (null assumes firefox) if remote.public.hub is set a RemoteWebDriver is created (Selenium Grid) if proxy.host is set, the web driver is setup to use a proxy |
static void |
login(org.openqa.selenium.WebDriver driver,
String userName,
Failable failable)
If the JVM arg remote.autologin is set, auto login as admin will not be done. |
protected static void |
selectFrameSafe(org.openqa.selenium.WebDriver driver,
String locator)
|
static org.openqa.selenium.WebDriver |
setUp(String username,
String url)
Setup the WebDriver test, login, and load the given web page |
static org.openqa.selenium.WebDriver |
setUp(String username,
String url,
String className,
String testName)
Setup the WebDriver test, login, and load the given web page |
static void |
tearDown(boolean passed,
String sessionId,
String testParam,
String userParam)
|
static void |
waitFor(org.openqa.selenium.WebDriver driver,
int waitSeconds,
org.openqa.selenium.By by,
String message)
Wait for the given amount of seconds, for the given by, using the given driver. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int DEFAULT_IMPLICIT_WAIT_TIME
public static int SHORT_IMPLICIT_WAIT_TIME
public static final String REMOTE_DRIVER_SAUCELABS_PROPERTY
public static final String WEBDRIVER_CHROME_DRIVER
public static final String REMOTE_PUBLIC_CHROME
public static final int SETUP_URL_LOAD_WAIT_SECONDS
public static final String PROXY_HOST_PROPERTY
Constructor Detail |
---|
public WebDriverUtil()
Method Detail |
---|
public static org.openqa.selenium.WebDriver setUp(String username, String url) throws Exception
username
- url
-
Exception
public static org.openqa.selenium.WebDriver setUp(String username, String url, String className, String testName) throws Exception
username
- url
- className
- testName
-
Exception
public static void tearDown(boolean passed, String sessionId, String testParam, String userParam) throws Exception
passed
- sessionId
- testParam
- userParam
-
Exception
public static String determineUser(String testParam)
testParam
-
public static void checkForIncidentReport(org.openqa.selenium.WebDriver driver, String locator, Failable failable, String message)
driver
- locator
- message
- public static org.openqa.selenium.chrome.ChromeDriverService chromeDriverCreateCheck()
public static org.openqa.selenium.WebDriver getWebDriver()
public static void login(org.openqa.selenium.WebDriver driver, String userName, Failable failable) throws InterruptedException
driver
- userName
- failable
-
InterruptedException
protected static void selectFrameSafe(org.openqa.selenium.WebDriver driver, String locator)
public static void waitFor(org.openqa.selenium.WebDriver driver, int waitSeconds, org.openqa.selenium.By by, String message) throws InterruptedException
driver
- WebDriverwaitSeconds
- intby
- Bymessage
- String
InterruptedException
public static void failOnMatchedJira(String contents, Failable failable)
public static String deLinespace(String contents)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |