|
||||||||||
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 boolean |
JGROWL_ERROR_FAILURE
false TODO upgrade to config via JVM param. |
static boolean |
jGrowlEnabled
|
static String |
JS_HIGHLIGHT_BACKGROUND
green |
static String |
JS_HIGHLIGHT_BOARDER
green |
static String |
JS_HIGHLIGHT_INPUT_PROPERTY
-Dremote.driver.highlight.input= |
static int |
JS_HIGHLIGHT_MS
400 milliseconds |
static String |
JS_HIGHLIGHT_MS_PROPERTY
-Dremote.driver.highlight.ms= |
static String |
JS_HIGHLIGHT_PROPERTY
-Dremote.driver.highlight=true to enable highlighting of elements as selenium runs |
static boolean |
jsHighlightEnabled
|
static String |
PROXY_HOST_PROPERTY
local proxy used for running tests thru jmeter. |
static String |
REMOTE_JGROWL_ENABLED
Set -Dremote.jgrowl.enabled= |
static String |
REMOTE_LOGIN_UIF
Set -Dremote.login.uif=KNS to use old login screen. |
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 |
highlightElement(org.openqa.selenium.WebDriver webDriver,
org.openqa.selenium.WebElement webElement)
|
static boolean |
isKradLogin()
Use the KRAD Login Screen or the old KNS Login Screen |
static void |
jGrowl(org.openqa.selenium.WebDriver driver,
String jGrowlHeader,
boolean sticky,
String message)
|
static void |
jGrowl(org.openqa.selenium.WebDriver driver,
String jGrowlHeader,
boolean sticky,
String message,
Throwable t)
|
static void |
jGrowlException(Throwable t)
|
static void |
kradLogin(org.openqa.selenium.WebDriver driver,
String userName,
Failable failable)
Logs in using the KRAD Login Page If the JVM arg remote.autologin is set, auto login as admin will not be done. |
static void |
login(org.openqa.selenium.WebDriver driver,
String userName,
Failable failable)
Logs into the Rice portal using the KNS Style Login Page. |
static void |
loginKradOrKns(org.openqa.selenium.WebDriver driver,
String user,
Failable failable)
|
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 org.openqa.selenium.WebElement |
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. |
static void |
waitFors(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 boolean jGrowlEnabled
public static boolean jsHighlightEnabled
public static int DEFAULT_IMPLICIT_WAIT_TIME
public static final boolean JGROWL_ERROR_FAILURE
public static final String JS_HIGHLIGHT_BACKGROUND
public static final String JS_HIGHLIGHT_BOARDER
public static final int JS_HIGHLIGHT_MS
public static final String JS_HIGHLIGHT_MS_PROPERTY
public static final String JS_HIGHLIGHT_PROPERTY
public static final String JS_HIGHLIGHT_INPUT_PROPERTY
public static int SHORT_IMPLICIT_WAIT_TIME
public static final String WEBDRIVER_CHROME_DRIVER
public static final String REMOTE_JGROWL_ENABLED
public static final String REMOTE_LOGIN_UIF
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 void jGrowl(org.openqa.selenium.WebDriver driver, String jGrowlHeader, boolean sticky, String message, Throwable t)
public static void jGrowl(org.openqa.selenium.WebDriver driver, String jGrowlHeader, boolean sticky, String message)
public static void jGrowlException(Throwable t)
public static void highlightElement(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.WebElement webElement)
public static org.openqa.selenium.WebDriver getWebDriver()
public static void kradLogin(org.openqa.selenium.WebDriver driver, String userName, Failable failable) throws InterruptedException
driver
- userName
- failable
-
InterruptedException
public static void login(org.openqa.selenium.WebDriver driver, String userName, Failable failable) throws InterruptedException
driver
- userName
- failable
-
InterruptedException
public static void loginKradOrKns(org.openqa.selenium.WebDriver driver, String user, Failable failable) throws InterruptedException
InterruptedException
public static boolean isKradLogin()
protected static void selectFrameSafe(org.openqa.selenium.WebDriver driver, String locator)
public static org.openqa.selenium.WebElement 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 waitFors(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 |