Package org.apache.tapestry5.test
Class SeleniumTestCase
-
- org.testng.Assert
-
- org.apache.tapestry5.test.SeleniumTestCase
-
- All Implemented Interfaces:
com.thoughtworks.selenium.Selenium
public abstract class SeleniumTestCase extends org.testng.Assert implements com.thoughtworks.selenium.Selenium
Base class for creating Selenium-based integration test cases. This class implements all the methods ofSelenium
and delegates to an instance (setup once per test bytestStartup(org.testng.ITestContext, org.testng.xml.XmlTest)
.- Since:
- 5.2.0
-
-
Field Summary
Fields Modifier and Type Field Description static
JETTY_7
static org.slf4j.Logger
LOGGER
static
PAGE_LOAD_TIMEOUT
15 secondsprotected com.thoughtworks.selenium.Selenium
selenium
Deprecated.static
SUBMIT
An XPath expression for locating a submit element (very commonly used withclickAndWait(String)
.static
TOMCAT_6
protected org.openqa.selenium.WebDriver
webDriver
-
Constructor Summary
Constructors Constructor Description SeleniumTestCase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
key, value)
void
strategyName, functionDefinition)
void
scriptContent, scriptTagId)
void
locator, optionLocator)
void
allow)
void
altKeyDown()
void
altKeyUp()
void
answer)
protected void
locator, expected)
Used when the locator identifies an attribute, not an element.protected void
locator, expected)
Assets that the value in the field matches the expectationprotected void
... expected)
Assets that each string provided is present somewhere in the current document.protected void
locator, expected)
Asserts the text of an element, identified by the locator.protected void
... text)
protected void
expected)
Asserts that the current page's title matches the expected value.void
locator, identifier)
void
fieldLocator, fileLocator)
void
filename, kwargs)
kwargs)
type)
void
filename)
captureScreenshotToString()
void
locator)
void
chooseCancelOnNextConfirmation()
void
chooseOkOnNextConfirmation()
void
cleanup()
void
cleanupTestMethod()
void
locator)
protected void
locator)
Click a link identified by a locator, then wait for the resulting page to load.void
locator, coordString)
void
close()
void
locator)
void
locator, coordString)
void
controlKeyDown()
void
controlKeyUp()
protected static org.openqa.selenium.By
locator)
void
nameValuePair, optionsString)
void
deleteAllVisibleCookies()
void
name, optionsString)
void
deselectPopUp()
void
locator)
void
locator, coordString)
void
locator, movementsString)
void
locatorOfObjectToBeDragged, locatorOfDragDestinationObject)
void
locator, movementsString)
void
locator, eventName)
void
locator)
getAlert()
[]
getAllButtons()
[]
getAllFields()
[]
getAllLinks()
[]
getAllWindowIds()
[]
getAllWindowNames()
[]
getAllWindowTitles()
attributeLocator)
[]
attributeName)
getBaseURL()
Returns the base URL for the application.getBodyText()
getConfirmation()
getCookie()
name)
str)
locator)
locator)
locator)
locator)
locator)
locator)
script)
expression)
getHtmlSource()
getLocation()
getLog()
getMouseSpeed()
getPrompt()
selectLocator)
[]
selectLocator)
selectLocator)
[]
selectLocator)
selectLocator)
[]
selectLocator)
selectLocator)
[]
selectLocator)
[]
selectLocator)
getSpeed()
tableCellAddress)
locator)
getTitle()
locator)
boolean
currentFrameString, target)
boolean
currentWindowString, target)
xpath)
void
goBack()
void
locator)
void
ignore)
void
testMethod)
boolean
isAlertPresent()
boolean
locator)
boolean
isConfirmationPresent()
boolean
name)
boolean
locator)
boolean
locator)
boolean
locator1, locator2)
boolean
isPromptPresent()
boolean
selectLocator)
boolean
pattern)
boolean
locator)
void
locator, keySequence)
void
keycode)
void
locator, keySequence)
void
keycode)
void
locator, keySequence)
void
keycode)
protected
container, webAppFolder, contextPath, int port, int sslPort)
Invoked fromtestStartup(org.testng.ITestContext, org.testng.xml.XmlTest)
to launch the web server to be tested.void
metaKeyDown()
void
metaKeyUp()
void
locator)
void
locator, coordString)
void
locator)
void
locator, coordString)
void
locator)
void
locator, coordString)
void
locator)
void
locator)
void
locator)
void
locator, coordString)
void
locator)
void
locator, coordString)
void
url)
void
url, ignoreResponseCode)
protected void
openBaseURL()
Open the getBaseURL(), and waits for the page to load.protected void
... linkText)
Opens the base URL, then clicks through a series of links to get to a desired application state.void
url, windowID)
void
refresh()
void
locator)
void
scriptTagId)
void
locator, optionLocator)
protected void
message, ... arguments)
Formats a message from the provided arguments, which is written to System.err.retrieveLastRemoteControlLogs()
void
rollupName, kwargs)
void
script)
void
scrollIntoView(org.openqa.selenium.WebElement element)
void
selectLocator, optionLocator)
void
locator)
void
windowID)
void
windowID)
void
logLevel)
void
context)
void
locator, position)
void
extensionJs)
void
pixels)
void
value)
void
timeout)
void
setup(org.testng.ITestContext context)
void
shiftKeyDown()
void
shiftKeyUp()
void
showContextualBanner()
void
className, methodName)
void
shutDownSeleniumServer()
protected void
sleep(long millis)
Sleeps for the indicated number of seconds.void
start()
void
optionsObject)
void
optionsString)
void
stop()
void
formLocator)
void
testShutdown(org.testng.ITestContext context)
LiketestStartup(org.testng.ITestContext, org.testng.xml.XmlTest)
, this may be called multiple times against multiple instances, but only does work the first time.void
testStartup(org.testng.ITestContext testContext, org.testng.xml.XmlTest xmlTest)
Starts up the servers for the entire test (i.e., for multiple TestCases).void
locator, value)
void
locator, value)
void
locator)
protected void
unreachable()
void
libraryName)
protected void
waitForAjaxRequestsToComplete()
Waits until all active XHR requests (as noted by the t5/core/dom module) have completed.protected void
timeout)
Deprecated.Deprecated in 5.4 in favor of the version without a timeoutvoid
script, timeout)
protected void
waitForCondition(org.openqa.selenium.support.ui.ExpectedCondition condition)
protected void
waitForCondition(org.openqa.selenium.support.ui.ExpectedCondition condition, long timeoutSeconds)
protected void
selector)
Waits for an element with a given CSS selector to appear.protected void
elementId)
Waits for the element with the given client-side id to be present in the DOM ( does not assure that the element is visible).protected void
elementId)
Deprecated.Deprecated in 5.4 with no replacementvoid
frameAddress, timeout)
protected void
selector)
Waits for the element specified by the selector to become invisible Note that waitForElementToDisappear waits for the element to be absent from the dom, visible or not.protected void
waitForPageToLoad()
Waits for the page to load (up to 15 seconds).void
timeout)
Waits for page to load, then waits for initialization to finish, which is recognized by thedata-page-initialized
attribute being set to true on the body element.void
windowID, timeout)
protected void
selector)
Waits for the element specified by the selector to become visible Note that waitForElementToAppear waits for the element to be present in the dom, visible or not.void
windowFocus()
void
windowMaximize()
protected void
reportText)
Delegates toErrorReporter.writeErrorReport(String)
to capture the current page markup in a file for later analysis.-
Methods inherited from class org.testng.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsNoOrder, assertEqualsNoOrder, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, fail
-
-
-
-
Field Detail
-
LOGGER
public static final org.slf4j.Logger LOGGER
-
PAGE_LOAD_TIMEOUT
public static final PAGE_LOAD_TIMEOUT
15 seconds- See Also:
- Constant Field Values
-
TOMCAT_6
public static final TOMCAT_6
- See Also:
- Constant Field Values
-
JETTY_7
public static final JETTY_7
- See Also:
- Constant Field Values
-
SUBMIT
public static final SUBMIT
An XPath expression for locating a submit element (very commonly used withclickAndWait(String)
.- Since:
- 5.3
- See Also:
- Constant Field Values
-
selenium
protected com.thoughtworks.selenium.Selenium selenium
Deprecated.The underlyingSelenium
instance that all the methods of this class delegate to; this can be useful when attempting to use SeleniumTestCase with a newer version of Selenium which has added some methods to the interface. This field will not be set until the test case instance has gone through its full initialization.- Since:
- 5.3
-
webDriver
protected org.openqa.selenium.WebDriver webDriver
-
-
Constructor Detail
-
SeleniumTestCase
public SeleniumTestCase()
-
-
Method Detail
-
testStartup
public void testStartup(org.testng.ITestContext testContext, org.testng.xml.XmlTest xmlTest) throws
Starts up the servers for the entire test (i.e., for multiple TestCases). By placing <parameter> elements inside the appropriate <test> (of your testng.xml configuration file), you can change the configuration or behavior of the servers. It is common to have two or more identical tests that differ only in terms of thetapestry.browser-start-command
parameter, to run tests against multiple browsers.Parameter Name Default Description container tapestry.servlet-container JETTY_7 The Servlet container to use for the tests. Currently JETTY_7
orTOMCAT_6
webAppFolder tapestry.web-app-folder src/main/webapp Location of web application context contextPath tapestry.context-path empty string Context path (defaults to root). As elsewhere, the context path should be blank, or start with a slash (but not end with one). port tapestry.port 9090 Port number for web server to listen to sslPort tapestry.ssl-port 8443 Port number for web server to listen to for secure requests browserStartCommand tapestry.browser-start-command *firefox Command string used to launch the browser, as defined by Selenium Options and defaults ITestContext
to see if the necessary keys are already present).- Parameters:
testContext
- Used to share objects between the launcher and the test suites- Throws:
-
testShutdown
public void testShutdown(org.testng.ITestContext context)
LiketestStartup(org.testng.ITestContext, org.testng.xml.XmlTest)
, this may be called multiple times against multiple instances, but only does work the first time.
-
launchWebServer
protected container, webAppFolder, contextPath, int port, int sslPort) throws
Invoked fromtestStartup(org.testng.ITestContext, org.testng.xml.XmlTest)
to launch the web server to be tested. The return value is a Runnable that can be invoked later to cleanly shut down the launched server at the end of the test.- Parameters:
container
- identifies which web server should be launchedwebAppFolder
- path to the web application contextcontextPath
- the path the context is mapped to, usually the empty stringport
- the port number the server should handlesslPort
- the port number on which the server should handle secure requests- Returns:
- Runnable used to shut down the server
- Throws:
-
setup
public void setup(org.testng.ITestContext context)
-
cleanup
public void cleanup()
-
writeErrorReport
protected void reportText)
Delegates toErrorReporter.writeErrorReport(String)
to capture the current page markup in a file for later analysis.
-
getBaseURL
public getBaseURL()
Returns the base URL for the application. This is of the typicallyhttp://localhost:9999/
(i.e., it includes a trailing slash). Generally, you should useopenLinks(String...)
to start from your application's home page.
-
indicateTestMethodName
public void testMethod)
-
cleanupTestMethod
public void cleanupTestMethod()
-
addCustomRequestHeader
public void key, value)
- Specified by:
addCustomRequestHeader
in interfacecom.thoughtworks.selenium.Selenium
-
addLocationStrategy
public void strategyName, functionDefinition)
- Specified by:
addLocationStrategy
in interfacecom.thoughtworks.selenium.Selenium
-
addScript
public void scriptContent, scriptTagId)
- Specified by:
addScript
in interfacecom.thoughtworks.selenium.Selenium
-
addSelection
public void locator, optionLocator)
- Specified by:
addSelection
in interfacecom.thoughtworks.selenium.Selenium
-
allowNativeXpath
public void allow)
- Specified by:
allowNativeXpath
in interfacecom.thoughtworks.selenium.Selenium
-
altKeyDown
public void altKeyDown()
- Specified by:
altKeyDown
in interfacecom.thoughtworks.selenium.Selenium
-
altKeyUp
public void altKeyUp()
- Specified by:
altKeyUp
in interfacecom.thoughtworks.selenium.Selenium
-
answerOnNextPrompt
public void answer)
- Specified by:
answerOnNextPrompt
in interfacecom.thoughtworks.selenium.Selenium
-
assignId
public void locator, identifier)
- Specified by:
assignId
in interfacecom.thoughtworks.selenium.Selenium
-
attachFile
public void fieldLocator, fileLocator)
- Specified by:
attachFile
in interfacecom.thoughtworks.selenium.Selenium
-
captureEntirePageScreenshot
public void filename, kwargs)
- Specified by:
captureEntirePageScreenshot
in interfacecom.thoughtworks.selenium.Selenium
-
captureEntirePageScreenshotToString
public kwargs)
- Specified by:
captureEntirePageScreenshotToString
in interfacecom.thoughtworks.selenium.Selenium
-
captureNetworkTraffic
public type)
- Specified by:
captureNetworkTraffic
in interfacecom.thoughtworks.selenium.Selenium
-
captureScreenshot
public void filename)
- Specified by:
captureScreenshot
in interfacecom.thoughtworks.selenium.Selenium
-
captureScreenshotToString
public captureScreenshotToString()
- Specified by:
captureScreenshotToString
in interfacecom.thoughtworks.selenium.Selenium
-
check
public void locator)
- Specified by:
check
in interfacecom.thoughtworks.selenium.Selenium
-
chooseCancelOnNextConfirmation
public void chooseCancelOnNextConfirmation()
- Specified by:
chooseCancelOnNextConfirmation
in interfacecom.thoughtworks.selenium.Selenium
-
chooseOkOnNextConfirmation
public void chooseOkOnNextConfirmation()
- Specified by:
chooseOkOnNextConfirmation
in interfacecom.thoughtworks.selenium.Selenium
-
click
public void locator)
- Specified by:
click
in interfacecom.thoughtworks.selenium.Selenium
-
clickAt
public void locator, coordString)
- Specified by:
clickAt
in interfacecom.thoughtworks.selenium.Selenium
-
close
public void close()
- Specified by:
close
in interfacecom.thoughtworks.selenium.Selenium
-
contextMenu
public void locator)
- Specified by:
contextMenu
in interfacecom.thoughtworks.selenium.Selenium
-
contextMenuAt
public void locator, coordString)
- Specified by:
contextMenuAt
in interfacecom.thoughtworks.selenium.Selenium
-
controlKeyDown
public void controlKeyDown()
- Specified by:
controlKeyDown
in interfacecom.thoughtworks.selenium.Selenium
-
controlKeyUp
public void controlKeyUp()
- Specified by:
controlKeyUp
in interfacecom.thoughtworks.selenium.Selenium
-
createCookie
public void nameValuePair, optionsString)
- Specified by:
createCookie
in interfacecom.thoughtworks.selenium.Selenium
-
deleteAllVisibleCookies
public void deleteAllVisibleCookies()
- Specified by:
deleteAllVisibleCookies
in interfacecom.thoughtworks.selenium.Selenium
-
deleteCookie
public void name, optionsString)
- Specified by:
deleteCookie
in interfacecom.thoughtworks.selenium.Selenium
-
deselectPopUp
public void deselectPopUp()
- Specified by:
deselectPopUp
in interfacecom.thoughtworks.selenium.Selenium
-
doubleClick
public void locator)
- Specified by:
doubleClick
in interfacecom.thoughtworks.selenium.Selenium
-
doubleClickAt
public void locator, coordString)
- Specified by:
doubleClickAt
in interfacecom.thoughtworks.selenium.Selenium
-
dragAndDrop
public void locator, movementsString)
- Specified by:
dragAndDrop
in interfacecom.thoughtworks.selenium.Selenium
-
dragAndDropToObject
public void locatorOfObjectToBeDragged, locatorOfDragDestinationObject)
- Specified by:
dragAndDropToObject
in interfacecom.thoughtworks.selenium.Selenium
-
dragdrop
public void locator, movementsString)
- Specified by:
dragdrop
in interfacecom.thoughtworks.selenium.Selenium
-
fireEvent
public void locator, eventName)
- Specified by:
fireEvent
in interfacecom.thoughtworks.selenium.Selenium
-
focus
public void locator)
- Specified by:
focus
in interfacecom.thoughtworks.selenium.Selenium
-
getAlert
public getAlert()
- Specified by:
getAlert
in interfacecom.thoughtworks.selenium.Selenium
-
getAllButtons
public [] getAllButtons()
- Specified by:
getAllButtons
in interfacecom.thoughtworks.selenium.Selenium
-
getAllFields
public [] getAllFields()
- Specified by:
getAllFields
in interfacecom.thoughtworks.selenium.Selenium
-
getAllLinks
public [] getAllLinks()
- Specified by:
getAllLinks
in interfacecom.thoughtworks.selenium.Selenium
-
getAllWindowIds
public [] getAllWindowIds()
- Specified by:
getAllWindowIds
in interfacecom.thoughtworks.selenium.Selenium
-
getAllWindowNames
public [] getAllWindowNames()
- Specified by:
getAllWindowNames
in interfacecom.thoughtworks.selenium.Selenium
-
getAllWindowTitles
public [] getAllWindowTitles()
- Specified by:
getAllWindowTitles
in interfacecom.thoughtworks.selenium.Selenium
-
getAttribute
public attributeLocator)
- Specified by:
getAttribute
in interfacecom.thoughtworks.selenium.Selenium
-
getAttributeFromAllWindows
public [] attributeName)
- Specified by:
getAttributeFromAllWindows
in interfacecom.thoughtworks.selenium.Selenium
-
getBodyText
public getBodyText()
- Specified by:
getBodyText
in interfacecom.thoughtworks.selenium.Selenium
-
getConfirmation
public getConfirmation()
- Specified by:
getConfirmation
in interfacecom.thoughtworks.selenium.Selenium
-
getCookie
public getCookie()
- Specified by:
getCookie
in interfacecom.thoughtworks.selenium.Selenium
-
getCookieByName
public name)
- Specified by:
getCookieByName
in interfacecom.thoughtworks.selenium.Selenium
-
getCursorPosition
public locator)
- Specified by:
getCursorPosition
in interfacecom.thoughtworks.selenium.Selenium
-
getElementHeight
public locator)
- Specified by:
getElementHeight
in interfacecom.thoughtworks.selenium.Selenium
-
getElementIndex
public locator)
- Specified by:
getElementIndex
in interfacecom.thoughtworks.selenium.Selenium
-
getElementPositionLeft
public locator)
- Specified by:
getElementPositionLeft
in interfacecom.thoughtworks.selenium.Selenium
-
getElementPositionTop
public locator)
- Specified by:
getElementPositionTop
in interfacecom.thoughtworks.selenium.Selenium
-
getElementWidth
public locator)
- Specified by:
getElementWidth
in interfacecom.thoughtworks.selenium.Selenium
-
getEval
public script)
- Specified by:
getEval
in interfacecom.thoughtworks.selenium.Selenium
-
getExpression
public expression)
- Specified by:
getExpression
in interfacecom.thoughtworks.selenium.Selenium
-
getHtmlSource
public getHtmlSource()
- Specified by:
getHtmlSource
in interfacecom.thoughtworks.selenium.Selenium
-
getLocation
public getLocation()
- Specified by:
getLocation
in interfacecom.thoughtworks.selenium.Selenium
-
getLog
public getLog()
- Specified by:
getLog
in interfacecom.thoughtworks.selenium.Selenium
-
getMouseSpeed
public getMouseSpeed()
- Specified by:
getMouseSpeed
in interfacecom.thoughtworks.selenium.Selenium
-
getPrompt
public getPrompt()
- Specified by:
getPrompt
in interfacecom.thoughtworks.selenium.Selenium
-
getSelectedId
public selectLocator)
- Specified by:
getSelectedId
in interfacecom.thoughtworks.selenium.Selenium
-
getSelectedIds
public [] selectLocator)
- Specified by:
getSelectedIds
in interfacecom.thoughtworks.selenium.Selenium
-
getSelectedIndex
public selectLocator)
- Specified by:
getSelectedIndex
in interfacecom.thoughtworks.selenium.Selenium
-
getSelectedIndexes
public [] selectLocator)
- Specified by:
getSelectedIndexes
in interfacecom.thoughtworks.selenium.Selenium
-
getSelectedLabel
public selectLocator)
- Specified by:
getSelectedLabel
in interfacecom.thoughtworks.selenium.Selenium
-
getSelectedLabels
public [] selectLocator)
- Specified by:
getSelectedLabels
in interfacecom.thoughtworks.selenium.Selenium
-
getSelectedValue
public selectLocator)
- Specified by:
getSelectedValue
in interfacecom.thoughtworks.selenium.Selenium
-
getSelectedValues
public [] selectLocator)
- Specified by:
getSelectedValues
in interfacecom.thoughtworks.selenium.Selenium
-
getSelectOptions
public [] selectLocator)
- Specified by:
getSelectOptions
in interfacecom.thoughtworks.selenium.Selenium
-
getSpeed
public getSpeed()
- Specified by:
getSpeed
in interfacecom.thoughtworks.selenium.Selenium
-
getTable
public tableCellAddress)
- Specified by:
getTable
in interfacecom.thoughtworks.selenium.Selenium
-
getText
public locator)
- Specified by:
getText
in interfacecom.thoughtworks.selenium.Selenium
-
getTitle
public getTitle()
- Specified by:
getTitle
in interfacecom.thoughtworks.selenium.Selenium
-
getValue
public locator)
- Specified by:
getValue
in interfacecom.thoughtworks.selenium.Selenium
-
getWhetherThisFrameMatchFrameExpression
public boolean currentFrameString, target)
- Specified by:
getWhetherThisFrameMatchFrameExpression
in interfacecom.thoughtworks.selenium.Selenium
-
getWhetherThisWindowMatchWindowExpression
public boolean currentWindowString, target)
- Specified by:
getWhetherThisWindowMatchWindowExpression
in interfacecom.thoughtworks.selenium.Selenium
-
getXpathCount
public xpath)
- Specified by:
getXpathCount
in interfacecom.thoughtworks.selenium.Selenium
-
goBack
public void goBack()
- Specified by:
goBack
in interfacecom.thoughtworks.selenium.Selenium
-
highlight
public void locator)
- Specified by:
highlight
in interfacecom.thoughtworks.selenium.Selenium
-
ignoreAttributesWithoutValue
public void ignore)
- Specified by:
ignoreAttributesWithoutValue
in interfacecom.thoughtworks.selenium.Selenium
-
isAlertPresent
public boolean isAlertPresent()
- Specified by:
isAlertPresent
in interfacecom.thoughtworks.selenium.Selenium
-
isChecked
public boolean locator)
- Specified by:
isChecked
in interfacecom.thoughtworks.selenium.Selenium
-
isConfirmationPresent
public boolean isConfirmationPresent()
- Specified by:
isConfirmationPresent
in interfacecom.thoughtworks.selenium.Selenium
-
isCookiePresent
public boolean name)
- Specified by:
isCookiePresent
in interfacecom.thoughtworks.selenium.Selenium
-
isEditable
public boolean locator)
- Specified by:
isEditable
in interfacecom.thoughtworks.selenium.Selenium
-
isElementPresent
public boolean locator)
- Specified by:
isElementPresent
in interfacecom.thoughtworks.selenium.Selenium
-
isOrdered
public boolean locator1, locator2)
- Specified by:
isOrdered
in interfacecom.thoughtworks.selenium.Selenium
-
isPromptPresent
public boolean isPromptPresent()
- Specified by:
isPromptPresent
in interfacecom.thoughtworks.selenium.Selenium
-
isSomethingSelected
public boolean selectLocator)
- Specified by:
isSomethingSelected
in interfacecom.thoughtworks.selenium.Selenium
-
isTextPresent
public boolean pattern)
- Specified by:
isTextPresent
in interfacecom.thoughtworks.selenium.Selenium
-
isVisible
public boolean locator)
- Specified by:
isVisible
in interfacecom.thoughtworks.selenium.Selenium
-
keyDown
public void locator, keySequence)
- Specified by:
keyDown
in interfacecom.thoughtworks.selenium.Selenium
-
keyDownNative
public void keycode)
- Specified by:
keyDownNative
in interfacecom.thoughtworks.selenium.Selenium
-
keyPress
public void locator, keySequence)
- Specified by:
keyPress
in interfacecom.thoughtworks.selenium.Selenium
-
keyPressNative
public void keycode)
- Specified by:
keyPressNative
in interfacecom.thoughtworks.selenium.Selenium
-
keyUp
public void locator, keySequence)
- Specified by:
keyUp
in interfacecom.thoughtworks.selenium.Selenium
-
keyUpNative
public void keycode)
- Specified by:
keyUpNative
in interfacecom.thoughtworks.selenium.Selenium
-
metaKeyDown
public void metaKeyDown()
- Specified by:
metaKeyDown
in interfacecom.thoughtworks.selenium.Selenium
-
metaKeyUp
public void metaKeyUp()
- Specified by:
metaKeyUp
in interfacecom.thoughtworks.selenium.Selenium
-
mouseDown
public void locator)
- Specified by:
mouseDown
in interfacecom.thoughtworks.selenium.Selenium
-
mouseDownAt
public void locator, coordString)
- Specified by:
mouseDownAt
in interfacecom.thoughtworks.selenium.Selenium
-
mouseDownRight
public void locator)
- Specified by:
mouseDownRight
in interfacecom.thoughtworks.selenium.Selenium
-
mouseDownRightAt
public void locator, coordString)
- Specified by:
mouseDownRightAt
in interfacecom.thoughtworks.selenium.Selenium
-
mouseMove
public void locator)
- Specified by:
mouseMove
in interfacecom.thoughtworks.selenium.Selenium
-
mouseMoveAt
public void locator, coordString)
- Specified by:
mouseMoveAt
in interfacecom.thoughtworks.selenium.Selenium
-
mouseOut
public void locator)
- Specified by:
mouseOut
in interfacecom.thoughtworks.selenium.Selenium
-
mouseOver
public void locator)
- Specified by:
mouseOver
in interfacecom.thoughtworks.selenium.Selenium
-
mouseUp
public void locator)
- Specified by:
mouseUp
in interfacecom.thoughtworks.selenium.Selenium
-
mouseUpAt
public void locator, coordString)
- Specified by:
mouseUpAt
in interfacecom.thoughtworks.selenium.Selenium
-
mouseUpRight
public void locator)
- Specified by:
mouseUpRight
in interfacecom.thoughtworks.selenium.Selenium
-
mouseUpRightAt
public void locator, coordString)
- Specified by:
mouseUpRightAt
in interfacecom.thoughtworks.selenium.Selenium
-
open
public void url)
- Specified by:
open
in interfacecom.thoughtworks.selenium.Selenium
-
open
public void url, ignoreResponseCode)
- Specified by:
open
in interfacecom.thoughtworks.selenium.Selenium
-
openWindow
public void url, windowID)
- Specified by:
openWindow
in interfacecom.thoughtworks.selenium.Selenium
-
refresh
public void refresh()
- Specified by:
refresh
in interfacecom.thoughtworks.selenium.Selenium
-
removeAllSelections
public void locator)
- Specified by:
removeAllSelections
in interfacecom.thoughtworks.selenium.Selenium
-
removeScript
public void scriptTagId)
- Specified by:
removeScript
in interfacecom.thoughtworks.selenium.Selenium
-
removeSelection
public void locator, optionLocator)
- Specified by:
removeSelection
in interfacecom.thoughtworks.selenium.Selenium
-
retrieveLastRemoteControlLogs
public retrieveLastRemoteControlLogs()
- Specified by:
retrieveLastRemoteControlLogs
in interfacecom.thoughtworks.selenium.Selenium
-
rollup
public void rollupName, kwargs)
- Specified by:
rollup
in interfacecom.thoughtworks.selenium.Selenium
-
runScript
public void script)
- Specified by:
runScript
in interfacecom.thoughtworks.selenium.Selenium
-
select
public void selectLocator, optionLocator)
- Specified by:
select
in interfacecom.thoughtworks.selenium.Selenium
-
selectFrame
public void locator)
- Specified by:
selectFrame
in interfacecom.thoughtworks.selenium.Selenium
-
selectPopUp
public void windowID)
- Specified by:
selectPopUp
in interfacecom.thoughtworks.selenium.Selenium
-
selectWindow
public void windowID)
- Specified by:
selectWindow
in interfacecom.thoughtworks.selenium.Selenium
-
setBrowserLogLevel
public void logLevel)
- Specified by:
setBrowserLogLevel
in interfacecom.thoughtworks.selenium.Selenium
-
setContext
public void context)
- Specified by:
setContext
in interfacecom.thoughtworks.selenium.Selenium
-
setCursorPosition
public void locator, position)
- Specified by:
setCursorPosition
in interfacecom.thoughtworks.selenium.Selenium
-
setExtensionJs
public void extensionJs)
- Specified by:
setExtensionJs
in interfacecom.thoughtworks.selenium.Selenium
-
setMouseSpeed
public void pixels)
- Specified by:
setMouseSpeed
in interfacecom.thoughtworks.selenium.Selenium
-
setSpeed
public void value)
- Specified by:
setSpeed
in interfacecom.thoughtworks.selenium.Selenium
-
setTimeout
public void timeout)
- Specified by:
setTimeout
in interfacecom.thoughtworks.selenium.Selenium
-
shiftKeyDown
public void shiftKeyDown()
- Specified by:
shiftKeyDown
in interfacecom.thoughtworks.selenium.Selenium
-
shiftKeyUp
public void shiftKeyUp()
- Specified by:
shiftKeyUp
in interfacecom.thoughtworks.selenium.Selenium
-
showContextualBanner
public void showContextualBanner()
- Specified by:
showContextualBanner
in interfacecom.thoughtworks.selenium.Selenium
-
showContextualBanner
public void className, methodName)
- Specified by:
showContextualBanner
in interfacecom.thoughtworks.selenium.Selenium
-
shutDownSeleniumServer
public void shutDownSeleniumServer()
- Specified by:
shutDownSeleniumServer
in interfacecom.thoughtworks.selenium.Selenium
-
start
public void start()
- Specified by:
start
in interfacecom.thoughtworks.selenium.Selenium
-
start
public void optionsObject)
- Specified by:
start
in interfacecom.thoughtworks.selenium.Selenium
-
start
public void optionsString)
- Specified by:
start
in interfacecom.thoughtworks.selenium.Selenium
-
stop
public void stop()
- Specified by:
stop
in interfacecom.thoughtworks.selenium.Selenium
-
submit
public void formLocator)
- Specified by:
submit
in interfacecom.thoughtworks.selenium.Selenium
-
type
public void locator, value)
- Specified by:
type
in interfacecom.thoughtworks.selenium.Selenium
-
typeKeys
public void locator, value)
- Specified by:
typeKeys
in interfacecom.thoughtworks.selenium.Selenium
-
uncheck
public void locator)
- Specified by:
uncheck
in interfacecom.thoughtworks.selenium.Selenium
-
useXpathLibrary
public void libraryName)
- Specified by:
useXpathLibrary
in interfacecom.thoughtworks.selenium.Selenium
-
waitForCondition
public void script, timeout)
- Specified by:
waitForCondition
in interfacecom.thoughtworks.selenium.Selenium
-
waitForCondition
protected void waitForCondition(org.openqa.selenium.support.ui.ExpectedCondition condition)
-
waitForCondition
protected void waitForCondition(org.openqa.selenium.support.ui.ExpectedCondition condition, long timeoutSeconds)
-
waitForFrameToLoad
public void frameAddress, timeout)
- Specified by:
waitForFrameToLoad
in interfacecom.thoughtworks.selenium.Selenium
-
waitForPageToLoad
public void timeout)
Waits for page to load, then waits for initialization to finish, which is recognized by thedata-page-initialized
attribute being set to true on the body element. Polls at increasing intervals, for up-to 30 seconds (that's extraordinarily long, but helps sometimes when manually debugging a page that doesn't have the floating console enabled)..- Specified by:
waitForPageToLoad
in interfacecom.thoughtworks.selenium.Selenium
-
waitForPopUp
public void windowID, timeout)
- Specified by:
waitForPopUp
in interfacecom.thoughtworks.selenium.Selenium
-
windowFocus
public void windowFocus()
- Specified by:
windowFocus
in interfacecom.thoughtworks.selenium.Selenium
-
windowMaximize
public void windowMaximize()
- Specified by:
windowMaximize
in interfacecom.thoughtworks.selenium.Selenium
-
scrollIntoView
public void scrollIntoView(org.openqa.selenium.WebElement element)
-
reportAndThrowAssertionError
protected final void message, ... arguments)
Formats a message from the provided arguments, which is written to System.err. In addition, captures the AUT's markup, screenshot, and a report to the output directory.- Parameters:
message
-arguments
-- Since:
- 5.4
-
unreachable
protected final void unreachable()
-
openBaseURL
protected final void openBaseURL()
Open the getBaseURL(), and waits for the page to load.
-
assertText
protected final void locator, expected)
Asserts the text of an element, identified by the locator.- Parameters:
locator
- identifies the element whose text value is to be assertedexpected
- expected value for the element's text
-
assertTextPresent
protected final void ... text)
-
assertSourcePresent
protected final void ... expected)
Assets that each string provided is present somewhere in the current document.- Parameters:
expected
- string expected to be present
-
clickAndWait
protected final void locator)
Click a link identified by a locator, then wait for the resulting page to load. This is not useful for Ajax updates, just normal full-page refreshes.- Parameters:
locator
- identifies the link to click
-
waitForPageToLoad
protected final void waitForPageToLoad()
Waits for the page to load (up to 15 seconds). This is invoked after clicking on an element that forces a full page refresh.
-
assertAttribute
protected final void locator, expected)
Used when the locator identifies an attribute, not an element.- Parameters:
locator
- identifies the attribute whose value is to be assertedexpected
- expected value for the attribute
-
assertFieldValue
protected final void locator, expected)
Assets that the value in the field matches the expectation- Parameters:
locator
- identifies the fieldexpected
- expected value for the field- Since:
- 5.3
-
openLinks
protected final void ... linkText)
Opens the base URL, then clicks through a series of links to get to a desired application state.- Since:
- 5.3
-
sleep
protected final void sleep(long millis)
Sleeps for the indicated number of seconds.- Since:
- 5.3
-
waitForElementToAppear
protected final void elementId)
Waits for the element with the given client-side id to be present in the DOM ( does not assure that the element is visible).- Parameters:
elementId
- identifies the element- Since:
- 5.3
-
waitForCssSelectorToAppear
protected final void selector)
Waits for an element with a given CSS selector to appear.- Parameters:
selector
- the CSS selector to wait.- Since:
- 5.5
-
waitForElementToDisappear
protected final void elementId)
Deprecated.Deprecated in 5.4 with no replacementWaits for the element to be removed from the DOM. This implementation depends on window being extended with testSupport.isNotVisible().- Parameters:
elementId
- client-side id of element- Since:
- 5.3
-
waitForVisible
protected final void selector)
Waits for the element specified by the selector to become visible Note that waitForElementToAppear waits for the element to be present in the dom, visible or not. waitForVisible waits for an element that already exists in the dom to become visible.- Parameters:
selector
- element selector- Since:
- 5.3
-
waitForInvisible
protected final void selector)
Waits for the element specified by the selector to become invisible Note that waitForElementToDisappear waits for the element to be absent from the dom, visible or not. waitForInvisible waits for an existing element to become invisible.- Parameters:
selector
- element selector- Since:
- 5.3
-
assertTitle
protected final void expected)
Asserts that the current page's title matches the expected value.- Parameters:
expected
- value for title- Since:
- 5.3
-
waitForAjaxRequestsToComplete
protected final void timeout)
Deprecated.Deprecated in 5.4 in favor of the version without a timeoutWaits until all active XHR requests are completed.- Parameters:
timeout
- timeout to wait for (no longer used)- Since:
- 5.3
-
waitForAjaxRequestsToComplete
protected final void waitForAjaxRequestsToComplete()
Waits until all active XHR requests (as noted by the t5/core/dom module) have completed.- Since:
- 5.4
-
getCssCount
public str)
- Specified by:
getCssCount
in interfacecom.thoughtworks.selenium.Selenium
-
convertLocator
protected static org.openqa.selenium.By locator)
-
-