org.kuali.rice.testtools.selenium
Class WebDriverUtils

java.lang.Object
  extended by org.kuali.rice.testtools.selenium.WebDriverUtils

public class WebDriverUtils
extends Object

The goal of the WebDriverUtils class is to invert the dependencies on WebDriver from WebDriverLegacyITBase for reuse without having to extend WebDriverLegacyITBase.

For compatibility with JiraAwareFailureUtils, external test framework asserts and fails should not be called from WebDriverUtils, instead use JiraAwareAftBase.

For the first example see waitFor

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
WebDriverLegacyITBase

Field Summary
static String DEFAULT_BASE_URL
          http://localhost:8080/kr-dev
static String DEFAULT_BASE_URL_KRAD
          http://localhost:8080/krad-dev
static String DONT_TEAR_DOWN_ON_FAILURE_PROPERTY
           Set to true to not close the browser after the test has if the test failed.
static String DONT_TEAR_DOWN_PROPERTY
           Set to true to not close the browser after the test has run.
static String HUB_DRIVER_PROPERTY
          remote.public.driver
static String HUB_PROPERTY
          For use when running Selenium tests through a Selenium Hub.
static String HUB_URL_PROPERTY
          http://localhost:4444/wd/hub
static int IMPLICIT_WAIT_TIME_LOOP_MS
          wait Methods inter loop sleep period, default of 1000 Milliseconds.
static int IMPLICIT_WAIT_TIME_SECONDS_DEFAULT
           IMPLICIT_WAIT_TIME_SECONDS_DEFAULT to configure, default 30 seconds.
static boolean JGROWL_ERROR_FAILURE
          If true tests will fail on jGrowl errors, default of false TODO upgrade to config via JVM param.
static boolean jGrowlEnabled
           
static String JS_HIGHLIGHT_BACKGROUND
          green (#66FF33)
static String JS_HIGHLIGHT_BOARDER
          green (#66FF33)
static String JS_HIGHLIGHT_INPUT_PROPERTY
          TODO: playback for javascript highlighting.
static int JS_HIGHLIGHT_MS
          400 milliseconds.
static String JS_HIGHLIGHT_MS_PROPERTY
           JS_HIGHLIGHT_MS as default.
static String JS_HIGHLIGHT_PROPERTY
           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_AUTOLOGIN_PROPERTY
           Skip automatice login if set to anything other than true/
static String REMOTE_JGROWL_ENABLED
           Set to true to enable jGrowl test messages.
static String REMOTE_LOGIN_UIF
          Set -Dremote.login.uif=KNS to use old login screen.
static String REMOTE_PROPERTIES_PROPERTY
          Set -Dremote.property.file= to load proprties from file
static String REMOTE_PUBLIC_CHROME
          Set -Dremote.public.chrome= or WEBDRIVER_CHROME_DRIVER
static String REMOTE_PUBLIC_URL_PROPERTY
          -Dremote.public.url=
static String REMOTE_PUBLIC_USER_PROPERTY
          Set -Dremote.public.user= to the username to login as
static String REMOTE_PUBLIC_USERPOOL_PROPERTY
          You probably don't want to really be using a userpool, set -Dremote.public.userpool= to base url if you must.
static String REMOTE_PUBLIC_WAIT_SECONDS_PROPERTY
           Set -Dremote.public.wait.seconds to override DEFAULT_WAIT_SEC.
protected static SauceLabsWebDriverHelper saucelabs
           
static int SETUP_URL_LOAD_WAIT_SECONDS
           Time to wait for the URL used in setup to load, 120 seconds by default.
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
WebDriverUtils()
           
 
Method Summary
static void acceptAlertIfPresent(org.openqa.selenium.WebDriver driver)
           If an alert is present accept it print the alert text to System.out
static void alertAccept(org.openqa.selenium.WebDriver driver)
           Accept the javascript alert (clicking OK).
static void alertDismiss(org.openqa.selenium.WebDriver driver)
           Dismiss the javascript alert (clicking Cancel).
static String alertText(org.openqa.selenium.WebDriver driver)
           Return alert text.
static org.openqa.selenium.chrome.ChromeDriverService chromeDriverCreateCheck()
           ChromeDriver downloads, REMOTE_PUBLIC_CHROME, WEBDRIVER_CHROME_DRIVER, and HUB_DRIVER_PROPERTY
static int configuredImplicityWait()
           Return the configured implicity wait seconds, REMOTE_PUBLIC_WAIT_SECONDS_PROPERTY and IMPLICIT_WAIT_TIME_SECONDS_DEFAULT.
static String deLinespace(String contents)
           Remove double line spacing.
static String determineUser(String testParam)
           If REMOTE_PUBLIC_USER_PROPERTY property is set, return its value, else if REMOTE_PUBLIC_USERPOOL_PROPERTY is set use it to query the userpool service passing the testParam.
static boolean dontTearDownOnFailure(boolean passed)
          Given the boolean parameter and depending on if DONT_TEAR_DOWN_ON_FAILURE_PROPERTY is set to something other than n, don't tear down the browser window on a test failure.
static boolean dontTearDownPropertyNotSet()
           Setting the JVM arg remote.driver.dontTearDown to y or t leaves the browser window open when the test has completed.
static org.openqa.selenium.WebElement findButtonByText(org.openqa.selenium.WebDriver driver, String buttonText)
           Find Button by text.
static org.openqa.selenium.WebElement findElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By by)
           Find and highlight the WebElement using the given WebDriver and By.
static String getBaseUrlString()
           In order to run as a smoke test the ability to set the baseUrl via the JVM arg remote.public.url is required.
static org.openqa.selenium.WebElement getElementByAttributeValue(org.openqa.selenium.WebDriver driver, String attributeName, String value)
           Return the WebElement that has the attribute name with the given value.
static String getHubUrlString()
           In order to run as a smoke test under selenium grid the ability to set the hubUrl via the JVM arg remote.public.hub is required.
static org.openqa.selenium.WebDriver getWebDriver()
           remote.public.driver set to chrome or firefox (null assumes firefox).
static void highlightElement(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.By by)
           
static void highlightElement(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.WebElement webElement)
           Highlight given WebElement.
static void highlightElements(org.openqa.selenium.WebDriver webDriver, List<org.openqa.selenium.WebElement> webElements)
           
static boolean isAlertPresent(org.openqa.selenium.WebDriver driver)
           Return true if an alert is present, false if not.
static Boolean isTextPresent(org.openqa.selenium.WebDriver driver, String pageText, String text)
           
static void jGrowl(org.openqa.selenium.WebDriver driver, String jGrowlHeader, boolean sticky, String message)
           Display jGrowl.
static void jGrowl(org.openqa.selenium.WebDriver driver, String jGrowlHeader, boolean sticky, String message, Throwable throwable)
           Display jGrowl.
static void jGrowlException(Throwable throwable)
           Print jGrowl Excetion to System.out, if JGROWL_ERROR_FAILURE is set to true, fail.
static void selectFrameSafe(org.openqa.selenium.WebDriver driver, String locator)
           Select frame defined by locator without throwing an Exception if it doesn't exist.
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 stepMessage(String message)
           
static void tearDown(boolean passed, String sessionId, String poolParamTest, String poolParamUser, String className, String testName)
           Calls SauceLabsWebDriverHelper.tearDown(boolean, java.lang.String, java.lang.String, java.lang.String) if REMOTE_PUBLIC_USERPOOL_PROPERTY is enabled, calls a user pool url with the given poolParamTest and poolParamUser.
static org.openqa.selenium.WebElement waitAndGetElementByAttributeValue(org.openqa.selenium.WebDriver driver, String attribute, String attributeValue, int waitSeconds)
           Return the WebElement that has the attribute name with the given value within the given seconds to wait.
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 List<org.openqa.selenium.WebElement> waitFors(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By by)
           Wait for WebElements.
static List<org.openqa.selenium.WebElement> waitFors(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By by, String message)
           Wait for WebElements.
static List<org.openqa.selenium.WebElement> 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.
static void waitToAcceptAlert(org.openqa.selenium.WebDriver driver, int waitSeconds, String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

saucelabs

protected static SauceLabsWebDriverHelper saucelabs

jGrowlEnabled

public static boolean jGrowlEnabled

jsHighlightEnabled

public static boolean jsHighlightEnabled

DEFAULT_BASE_URL

public static final String DEFAULT_BASE_URL
http://localhost:8080/kr-dev

See Also:
Constant Field Values

DEFAULT_BASE_URL_KRAD

public static final String DEFAULT_BASE_URL_KRAD
http://localhost:8080/krad-dev

See Also:
Constant Field Values

DONT_TEAR_DOWN_PROPERTY

public static final String DONT_TEAR_DOWN_PROPERTY

Set to true to not close the browser after the test has run.

-Dremote.driver.dontTearDown=true

See Also:
Constant Field Values

DONT_TEAR_DOWN_ON_FAILURE_PROPERTY

public static final String DONT_TEAR_DOWN_ON_FAILURE_PROPERTY

Set to true to not close the browser after the test has if the test failed.

-Dremote.driver.dontTearDownOnFailure=true

See Also:
Constant Field Values

HUB_DRIVER_PROPERTY

public static final String HUB_DRIVER_PROPERTY
remote.public.driver

See Also:
Constant Field Values

HUB_PROPERTY

public static final String HUB_PROPERTY
For use when running Selenium tests through a Selenium Hub. -Dremote.public.hub=

See Also:
Constant Field Values

HUB_URL_PROPERTY

public static final String HUB_URL_PROPERTY
http://localhost:4444/wd/hub

See Also:
Constant Field Values

IMPLICIT_WAIT_TIME_LOOP_MS

public static int IMPLICIT_WAIT_TIME_LOOP_MS
wait Methods inter loop sleep period, default of 1000 Milliseconds. TODO parametrize for JVM Arg


IMPLICIT_WAIT_TIME_SECONDS_DEFAULT

public static int IMPLICIT_WAIT_TIME_SECONDS_DEFAULT

IMPLICIT_WAIT_TIME_SECONDS_DEFAULT to configure, default 30 seconds.

In code don't use this variable but call configuredImplicityWait to get the configured value.


JGROWL_ERROR_FAILURE

public static final boolean JGROWL_ERROR_FAILURE
If true tests will fail on jGrowl errors, default of false TODO upgrade to config via JVM param.

See Also:
Constant Field Values

JS_HIGHLIGHT_BACKGROUND

public static final String JS_HIGHLIGHT_BACKGROUND
green (#66FF33)

See Also:
Constant Field Values

JS_HIGHLIGHT_BOARDER

public static final String JS_HIGHLIGHT_BOARDER
green (#66FF33)

See Also:
Constant Field Values

JS_HIGHLIGHT_MS

public static final int JS_HIGHLIGHT_MS
400 milliseconds.

See Also:
Constant Field Values

JS_HIGHLIGHT_MS_PROPERTY

public static final String JS_HIGHLIGHT_MS_PROPERTY

JS_HIGHLIGHT_MS as default.

-Dremote.driver.highlight.ms=

See Also:
Constant Field Values

JS_HIGHLIGHT_PROPERTY

public static final String JS_HIGHLIGHT_PROPERTY

Highlighting of elements as selenium runs.

-Dremote.driver.highlight=true

See Also:
Constant Field Values

JS_HIGHLIGHT_INPUT_PROPERTY

public static final String JS_HIGHLIGHT_INPUT_PROPERTY
TODO: playback for javascript highlighting. -Dremote.driver.highlight.input=

See Also:
Constant Field Values

PROXY_HOST_PROPERTY

public static final String PROXY_HOST_PROPERTY

Local proxy used for running tests thru jmeter.

Include host name and port number. Example: localhost:7777

-Dremote.public.proxy=

See Also:
Constant Field Values

REMOTE_AUTOLOGIN_PROPERTY

public static final String REMOTE_AUTOLOGIN_PROPERTY

Skip automatice login if set to anything other than true/

-Dremote.autologin=false

See Also:
Constant Field Values

REMOTE_JGROWL_ENABLED

public static final String REMOTE_JGROWL_ENABLED

Set to true to enable jGrowl test messages.

When enabled, jGrowl messages will be sent when clicking on buttons and links identified by their text.

-Dremote.jgrowl.enabled=true

See Also:
Constant Field Values

REMOTE_LOGIN_UIF

public static final String REMOTE_LOGIN_UIF
Set -Dremote.login.uif=KNS to use old login screen. Default value = KRAD

See Also:
Constant Field Values

REMOTE_PROPERTIES_PROPERTY

public static final String REMOTE_PROPERTIES_PROPERTY
Set -Dremote.property.file= to load proprties from file

See Also:
Constant Field Values

REMOTE_PUBLIC_CHROME

public static final String REMOTE_PUBLIC_CHROME
Set -Dremote.public.chrome= or WEBDRIVER_CHROME_DRIVER

See Also:
Constant Field Values

REMOTE_PUBLIC_URL_PROPERTY

public static final String REMOTE_PUBLIC_URL_PROPERTY
-Dremote.public.url=

See Also:
Constant Field Values

REMOTE_PUBLIC_WAIT_SECONDS_PROPERTY

public static final String REMOTE_PUBLIC_WAIT_SECONDS_PROPERTY

Set -Dremote.public.wait.seconds to override DEFAULT_WAIT_SEC.

IMPLICIT_WAIT_TIME_SECONDS_DEFAULT

See Also:
Constant Field Values

REMOTE_PUBLIC_USER_PROPERTY

public static final String REMOTE_PUBLIC_USER_PROPERTY
Set -Dremote.public.user= to the username to login as

See Also:
Constant Field Values

REMOTE_PUBLIC_USERPOOL_PROPERTY

public static final String REMOTE_PUBLIC_USERPOOL_PROPERTY
You probably don't want to really be using a userpool, set -Dremote.public.userpool= to base url if you must.

See Also:
Constant Field Values

SETUP_URL_LOAD_WAIT_SECONDS

public static final int SETUP_URL_LOAD_WAIT_SECONDS

Time to wait for the URL used in setup to load, 120 seconds by default.

Sometimes this is the first hit on the app and it needs a bit longer than any other.

TODO parametrize for JVM Arg

See Also:
Constant Field Values

WEBDRIVER_CHROME_DRIVER

public static final String WEBDRIVER_CHROME_DRIVER
Selenium's webdriver.chrome.driver parameter, you can set -Dwebdriver.chrome.driver= or Rice's REMOTE_PUBLIC_CHROME.

See Also:
Constant Field Values
Constructor Detail

WebDriverUtils

public WebDriverUtils()
Method Detail

setUp

public static org.openqa.selenium.WebDriver setUp(String username,
                                                  String url)
                                           throws Exception
Setup the WebDriver test, login, and load the given web page

Parameters:
username -
url -
Returns:
driver
Throws:
Exception

setUp

public static org.openqa.selenium.WebDriver setUp(String username,
                                                  String url,
                                                  String className,
                                                  String testName)
                                           throws Exception
Setup the WebDriver test, login, and load the given web page

Parameters:
username -
url -
className -
testName -
Returns:
driver
Throws:
Exception

tearDown

public static void tearDown(boolean passed,
                            String sessionId,
                            String poolParamTest,
                            String poolParamUser,
                            String className,
                            String testName)
                     throws Exception

Calls SauceLabsWebDriverHelper.tearDown(boolean, java.lang.String, java.lang.String, java.lang.String) if REMOTE_PUBLIC_USERPOOL_PROPERTY is enabled, calls a user pool url with the given poolParamTest and poolParamUser.

Parameters:
passed - used by SauceLabsWebDriverHelper.tearDown(boolean, java.lang.String, java.lang.String, java.lang.String) to record Saucelabs test status can be null if Saucelabs is not being used
sessionId - used by SauceLabsWebDriverHelper.tearDown(boolean, java.lang.String, java.lang.String, java.lang.String) to record Saucelabs sessionId status can be null if Saucelabs is not being used
poolParamTest - can be null unless a user pool is being used
poolParamUser - can be null unless a user pool is being used
Throws:
Exception

acceptAlertIfPresent

public static void acceptAlertIfPresent(org.openqa.selenium.WebDriver driver)

If an alert is present accept it print the alert text to System.out

Parameters:
driver - to accept alert on

alertAccept

public static void alertAccept(org.openqa.selenium.WebDriver driver)

Accept the javascript alert (clicking OK).

Parameters:
driver - WebDriver to accept alert on

alertDismiss

public static void alertDismiss(org.openqa.selenium.WebDriver driver)

Dismiss the javascript alert (clicking Cancel).

Parameters:
driver - WebDriver to dismiss alert on

alertText

public static String alertText(org.openqa.selenium.WebDriver driver)

Return alert text.

Parameters:
driver - to get alert text from
Returns:
alert text

chromeDriverCreateCheck

public static org.openqa.selenium.chrome.ChromeDriverService chromeDriverCreateCheck()

ChromeDriver downloads, REMOTE_PUBLIC_CHROME, WEBDRIVER_CHROME_DRIVER, and HUB_DRIVER_PROPERTY

Returns:
chromeDriverService

configuredImplicityWait

public static int configuredImplicityWait()

Return the configured implicity wait seconds, REMOTE_PUBLIC_WAIT_SECONDS_PROPERTY and IMPLICIT_WAIT_TIME_SECONDS_DEFAULT.

Returns:
seconds for implicity wait

deLinespace

public static String deLinespace(String contents)

Remove double line spacing.

Parameters:
contents - String to remove double line spacing from
Returns:
String with double line spacing removed.

determineUser

public static String determineUser(String testParam)

If REMOTE_PUBLIC_USER_PROPERTY property is set, return its value, else if REMOTE_PUBLIC_USERPOOL_PROPERTY is set use it to query the userpool service passing the testParam.

*

Parameters:
testParam - to use if using a user pool
Returns:
user

dontTearDownPropertyNotSet

public static boolean dontTearDownPropertyNotSet()

Setting the JVM arg remote.driver.dontTearDown to y or t leaves the browser window open when the test has completed.

Valuable when debugging, updating, or creating new tests. When implementing your own tearDown method rather than an inherited one, it is a common courtesy to include this check and not stop and shutdown the browser window to make it easy debug or update your test.

Returns:
true if the dontTearDownProperty is not set.

dontTearDownOnFailure

public static boolean dontTearDownOnFailure(boolean passed)
Given the boolean parameter and depending on if DONT_TEAR_DOWN_ON_FAILURE_PROPERTY is set to something other than n, don't tear down the browser window on a test failure.

Parameters:
passed -
Returns:

findButtonByText

public static org.openqa.selenium.WebElement findButtonByText(org.openqa.selenium.WebDriver driver,
                                                              String buttonText)

Find Button by text.

Parameters:
driver - to find button on
buttonText - text to find button by
Returns:
WebElement of button with button text

findElement

public static org.openqa.selenium.WebElement findElement(org.openqa.selenium.WebDriver driver,
                                                         org.openqa.selenium.By by)

Find and highlight the WebElement using the given WebDriver and By.

Parameters:
driver - driver to find on
by - selector to find
Returns:

getBaseUrlString

public static String getBaseUrlString()

In order to run as a smoke test the ability to set the baseUrl via the JVM arg remote.public.url is required.

Trailing slashes are trimmed. If the remote.public.url does not start with http:// it will be added.

Returns:
http://localhost:8080/kr-dev by default else the value of remote.public.url

getElementByAttributeValue

public static org.openqa.selenium.WebElement getElementByAttributeValue(org.openqa.selenium.WebDriver driver,
                                                                        String attributeName,
                                                                        String value)

Return the WebElement that has the attribute name with the given value.

Parameters:
driver - to get element from
attributeName - attribute name to find element by
value - for the attribute name to find element by
Returns:
WebElement

getHubUrlString

public static String getHubUrlString()

In order to run as a smoke test under selenium grid the ability to set the hubUrl via the JVM arg remote.public.hub is required.

Trailing slashes are trimmed. If the remote.public.hub does not start with http:// it will be added.

Returns:
http://localhost:4444/wd/hub by default else the value of remote.public.hub

getWebDriver

public 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

Returns:
WebDriver or null if unable to create

highlightElement

public static void highlightElement(org.openqa.selenium.WebDriver webDriver,
                                    org.openqa.selenium.By by)

highlightElements

public static void highlightElements(org.openqa.selenium.WebDriver webDriver,
                                     List<org.openqa.selenium.WebElement> webElements)

highlightElement

public static void highlightElement(org.openqa.selenium.WebDriver webDriver,
                                    org.openqa.selenium.WebElement webElement)

Highlight given WebElement.

Parameters:
webDriver - to execute highlight on
webElement - to highlight

isAlertPresent

public static boolean isAlertPresent(org.openqa.selenium.WebDriver driver)

Return true if an alert is present, false if not.

Parameters:
driver - to check for presents of alert on
Returns:
true if there is an alert present, false if not

isTextPresent

public static Boolean isTextPresent(org.openqa.selenium.WebDriver driver,
                                    String pageText,
                                    String text)

jGrowl

public static void jGrowl(org.openqa.selenium.WebDriver driver,
                          String jGrowlHeader,
                          boolean sticky,
                          String message,
                          Throwable throwable)

Display jGrowl.

Parameters:
driver - WebDriver to execute jGrowl on
jGrowlHeader - header text for jGrowl
sticky - true to set the jGrowl to sticky, false for not sticky
message - message to display in the jGrowl
throwable - message and stacktrace to included in jGrowl

jGrowl

public static void jGrowl(org.openqa.selenium.WebDriver driver,
                          String jGrowlHeader,
                          boolean sticky,
                          String message)

Display jGrowl.

Parameters:
driver - WebDriver to execute jGrowl on
jGrowlHeader - header text for jGrowl
sticky - true to set the jGrowl to sticky, false for not sticky
message - message to display in the jGrowl

jGrowlException

public static void jGrowlException(Throwable throwable)

Print jGrowl Excetion to System.out, if JGROWL_ERROR_FAILURE is set to true, fail.

Parameters:
throwable - message and stack trace to print and if configured fail with

selectFrameSafe

public static void selectFrameSafe(org.openqa.selenium.WebDriver driver,
                                   String locator)

Select frame defined by locator without throwing an Exception if it doesn't exist.

Parameters:
driver - to select frame on
locator - to identify frame to select

stepMessage

public static void stepMessage(String message)

waitAndGetElementByAttributeValue

public static org.openqa.selenium.WebElement waitAndGetElementByAttributeValue(org.openqa.selenium.WebDriver driver,
                                                                               String attribute,
                                                                               String attributeValue,
                                                                               int waitSeconds)
                                                                        throws InterruptedException

Return the WebElement that has the attribute name with the given value within the given seconds to wait.

Parameters:
driver - to get element from
attribute - name to find element by
attributeValue - for the attribute name to find element by
waitSeconds - number of seconds to wait
Returns:
WebElement
Throws:
InterruptedException

waitToAcceptAlert

public static void waitToAcceptAlert(org.openqa.selenium.WebDriver driver,
                                     int waitSeconds,
                                     String message)
                              throws InterruptedException
Throws:
InterruptedException

waitFor

public static org.openqa.selenium.WebElement waitFor(org.openqa.selenium.WebDriver driver,
                                                     int waitSeconds,
                                                     org.openqa.selenium.By by,
                                                     String message)
                                              throws InterruptedException

Wait for the given amount of seconds, for the given by, using the given driver. The message is displayed if the by cannot be found. No action is performed on the by, so it is possible that the by found is not visible or enabled.

Parameters:
driver - WebDriver to wait on
waitSeconds - seconds to wait
by - By to wait for
message - to display if by is not found in waitSeconds
Throws:
InterruptedException

waitFors

public static List<org.openqa.selenium.WebElement> waitFors(org.openqa.selenium.WebDriver driver,
                                                            org.openqa.selenium.By by)
                                                     throws InterruptedException

Wait for WebElements.

Parameters:
driver - WebDriver to wait on
by - By to wait for
Returns:
Throws:
InterruptedException

waitFors

public static List<org.openqa.selenium.WebElement> waitFors(org.openqa.selenium.WebDriver driver,
                                                            org.openqa.selenium.By by,
                                                            String message)
                                                     throws InterruptedException

Wait for WebElements.

Parameters:
driver - WebDriver to wait on
by - By to wait for
message - to display if by is not found in waitSeconds
Returns:
List of WebElements found
Throws:
InterruptedException

waitFors

public static List<org.openqa.selenium.WebElement> waitFors(org.openqa.selenium.WebDriver driver,
                                                            int waitSeconds,
                                                            org.openqa.selenium.By by,
                                                            String message)
                                                     throws InterruptedException

Wait for the given amount of seconds, for the given by, using the given driver. The message is displayed if the by cannot be found. No action is performed on the by, so it is possible that the by found is not visible or enabled.

Parameters:
driver - WebDriver to wait on
waitSeconds - seconds to wait
by - By to wait for
message - to display if by is not found in waitSeconds
Returns:
List of WebElements found
Throws:
InterruptedException


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.