|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.testng.Assert org.apache.tapestry5.test.SeleniumTestCase
public abstract class SeleniumTestCase
Base class for creating Selenium-based integration test cases. This class implements all the
methods of Selenium
and delegates to an instance (setup once per test by
testStartup(org.testng.ITestContext, org.testng.xml.XmlTest)
.
Field Summary | |
---|---|
static String |
JETTY_7
|
static String |
PAGE_LOAD_TIMEOUT
15 seconds |
protected com.thoughtworks.selenium.Selenium |
selenium
The underlying Selenium 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. |
static String |
SUBMIT
An XPath expression for locating a submit element (very commonly used with clickAndWait(String) . |
static String |
TOMCAT_6
|
Constructor Summary | |
---|---|
SeleniumTestCase()
|
Method Summary | |
---|---|
void |
addCustomRequestHeader(String key,
String value)
|
void |
addLocationStrategy(String strategyName,
String functionDefinition)
|
void |
addScript(String scriptContent,
String scriptTagId)
|
void |
addSelection(String locator,
String optionLocator)
|
void |
allowNativeXpath(String allow)
|
void |
altKeyDown()
|
void |
altKeyUp()
|
void |
answerOnNextPrompt(String answer)
|
protected void |
assertAttribute(String locator,
String expected)
Used when the locator identifies an attribute, not an element. |
protected void |
assertFieldValue(String locator,
String expected)
Assets that the value in the field matches the expectation |
protected void |
assertSourcePresent(String... expected)
Assets that each string provided is present somewhere in the current document. |
protected void |
assertText(String locator,
String expected)
Asserts the text of an element, identified by the locator. |
protected void |
assertTextPresent(String... text)
|
protected void |
assertTitle(String expected)
Asserts that the current page's title matches the expected value. |
void |
assignId(String locator,
String identifier)
|
void |
attachFile(String fieldLocator,
String fileLocator)
|
void |
captureEntirePageScreenshot(String filename,
String kwargs)
|
String |
captureEntirePageScreenshotToString(String kwargs)
|
String |
captureNetworkTraffic(String type)
|
void |
captureScreenshot(String filename)
|
String |
captureScreenshotToString()
|
void |
check(String locator)
|
void |
chooseCancelOnNextConfirmation()
|
void |
chooseOkOnNextConfirmation()
|
void |
cleanup()
|
void |
cleanupTestMethod()
|
void |
click(String locator)
|
protected void |
clickAndWait(String locator)
Click a link identified by a locator, then wait for the resulting page to load. |
void |
clickAt(String locator,
String coordString)
|
void |
close()
|
void |
contextMenu(String locator)
|
void |
contextMenuAt(String locator,
String coordString)
|
void |
controlKeyDown()
|
void |
controlKeyUp()
|
void |
createCookie(String nameValuePair,
String optionsString)
|
void |
deleteAllVisibleCookies()
|
void |
deleteCookie(String name,
String optionsString)
|
void |
deselectPopUp()
|
void |
doubleClick(String locator)
|
void |
doubleClickAt(String locator,
String coordString)
|
void |
dragAndDrop(String locator,
String movementsString)
|
void |
dragAndDropToObject(String locatorOfObjectToBeDragged,
String locatorOfDragDestinationObject)
|
void |
dragdrop(String locator,
String movementsString)
|
void |
fireEvent(String locator,
String eventName)
|
void |
focus(String locator)
|
String |
getAlert()
|
String[] |
getAllButtons()
|
String[] |
getAllFields()
|
String[] |
getAllLinks()
|
String[] |
getAllWindowIds()
|
String[] |
getAllWindowNames()
|
String[] |
getAllWindowTitles()
|
String |
getAttribute(String attributeLocator)
|
String[] |
getAttributeFromAllWindows(String attributeName)
|
String |
getBaseURL()
Returns the base URL for the application. |
String |
getBodyText()
|
String |
getConfirmation()
|
String |
getCookie()
|
String |
getCookieByName(String name)
|
Number |
getCssCount(String str)
|
Number |
getCursorPosition(String locator)
|
Number |
getElementHeight(String locator)
|
Number |
getElementIndex(String locator)
|
Number |
getElementPositionLeft(String locator)
|
Number |
getElementPositionTop(String locator)
|
Number |
getElementWidth(String locator)
|
String |
getEval(String script)
|
String |
getExpression(String expression)
|
String |
getHtmlSource()
|
String |
getLocation()
|
String |
getLog()
|
Number |
getMouseSpeed()
|
String |
getPrompt()
|
String |
getSelectedId(String selectLocator)
|
String[] |
getSelectedIds(String selectLocator)
|
String |
getSelectedIndex(String selectLocator)
|
String[] |
getSelectedIndexes(String selectLocator)
|
String |
getSelectedLabel(String selectLocator)
|
String[] |
getSelectedLabels(String selectLocator)
|
String |
getSelectedValue(String selectLocator)
|
String[] |
getSelectedValues(String selectLocator)
|
String[] |
getSelectOptions(String selectLocator)
|
String |
getSpeed()
|
String |
getTable(String tableCellAddress)
|
String |
getText(String locator)
|
String |
getTitle()
|
String |
getValue(String locator)
|
boolean |
getWhetherThisFrameMatchFrameExpression(String currentFrameString,
String target)
|
boolean |
getWhetherThisWindowMatchWindowExpression(String currentWindowString,
String target)
|
Number |
getXpathCount(String xpath)
|
void |
goBack()
|
void |
highlight(String locator)
|
void |
ignoreAttributesWithoutValue(String ignore)
|
void |
indicateTestMethodName(Method testMethod)
|
boolean |
isAlertPresent()
|
boolean |
isChecked(String locator)
|
boolean |
isConfirmationPresent()
|
boolean |
isCookiePresent(String name)
|
boolean |
isEditable(String locator)
|
boolean |
isElementPresent(String locator)
|
boolean |
isOrdered(String locator1,
String locator2)
|
boolean |
isPromptPresent()
|
boolean |
isSomethingSelected(String selectLocator)
|
boolean |
isTextPresent(String pattern)
|
boolean |
isVisible(String locator)
|
void |
keyDown(String locator,
String keySequence)
|
void |
keyDownNative(String keycode)
|
void |
keyPress(String locator,
String keySequence)
|
void |
keyPressNative(String keycode)
|
void |
keyUp(String locator,
String keySequence)
|
void |
keyUpNative(String keycode)
|
protected Runnable |
launchWebServer(String container,
String webAppFolder,
String contextPath,
int port,
int sslPort)
Invoked from testStartup(org.testng.ITestContext, org.testng.xml.XmlTest) to launch the web
server to be tested. |
void |
metaKeyDown()
|
void |
metaKeyUp()
|
void |
mouseDown(String locator)
|
void |
mouseDownAt(String locator,
String coordString)
|
void |
mouseDownRight(String locator)
|
void |
mouseDownRightAt(String locator,
String coordString)
|
void |
mouseMove(String locator)
|
void |
mouseMoveAt(String locator,
String coordString)
|
void |
mouseOut(String locator)
|
void |
mouseOver(String locator)
|
void |
mouseUp(String locator)
|
void |
mouseUpAt(String locator,
String coordString)
|
void |
mouseUpRight(String locator)
|
void |
mouseUpRightAt(String locator,
String coordString)
|
void |
open(String url)
|
void |
open(String url,
String ignoreResponseCode)
|
protected void |
openBaseURL()
Open the getBaseURL(), and waits for the page to load. |
protected void |
openLinks(String... linkText)
Opens the base URL, then clicks through a series of links to get to a desired application state. |
void |
openWindow(String url,
String windowID)
|
void |
refresh()
|
void |
removeAllSelections(String locator)
|
void |
removeScript(String scriptTagId)
|
void |
removeSelection(String locator,
String optionLocator)
|
protected void |
reportAndThrowAssertionError(String message,
Object... arguments)
Formats a message from the provided arguments, which is written to System.err. |
String |
retrieveLastRemoteControlLogs()
|
void |
rollup(String rollupName,
String kwargs)
|
void |
runScript(String script)
|
void |
select(String selectLocator,
String optionLocator)
|
void |
selectFrame(String locator)
|
void |
selectPopUp(String windowID)
|
void |
selectWindow(String windowID)
|
void |
setBrowserLogLevel(String logLevel)
|
void |
setContext(String context)
|
void |
setCursorPosition(String locator,
String position)
|
void |
setExtensionJs(String extensionJs)
|
void |
setMouseSpeed(String pixels)
|
void |
setSpeed(String value)
|
void |
setTimeout(String timeout)
|
void |
setup(org.testng.ITestContext context)
|
void |
shiftKeyDown()
|
void |
shiftKeyUp()
|
void |
showContextualBanner()
|
void |
showContextualBanner(String className,
String methodName)
|
void |
shutDownSeleniumServer()
|
protected void |
sleep(long millis)
Sleeps for the indicated number of seconds. |
void |
start()
|
void |
start(Object optionsObject)
|
void |
start(String optionsString)
|
void |
stop()
|
void |
submit(String formLocator)
|
void |
testShutdown(org.testng.ITestContext context)
Like testStartup(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 |
type(String locator,
String value)
|
void |
typeKeys(String locator,
String value)
|
void |
uncheck(String locator)
|
protected void |
unreachable()
|
void |
useXpathLibrary(String libraryName)
|
protected void |
waitForAjaxRequestsToComplete(String timeout)
Deprecated. Deprecated in 5.4 as it is tied to Prototype. |
void |
waitForCondition(String script,
String timeout)
|
protected void |
waitForCSSSelectedElementToAppear(String cssRule)
Waits, up to the page load limit for an element (identified by a CSS rule) to exist (it is not assured that the element will be visible). |
protected void |
waitForElementToAppear(String 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 |
waitForElementToDisappear(String elementId)
Waits for the element to be removed from the DOM. |
void |
waitForFrameToLoad(String frameAddress,
String timeout)
|
protected void |
waitForInvisible(String 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 |
waitForPageInitialized()
Waits for page initialization to finish, which is recognized by the data-page-initialized attribute
being added to the HTML element. |
protected void |
waitForPageToLoad()
Waits for the page to load (up to 15 seconds). |
void |
waitForPageToLoad(String timeout)
|
void |
waitForPopUp(String windowID,
String timeout)
|
protected void |
waitForVisible(String 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 |
writeErrorReport(String reportText)
Delegates to ErrorReporter#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, assertEqualsNoOrder, assertEqualsNoOrder, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PAGE_LOAD_TIMEOUT
public static final String TOMCAT_6
public static final String JETTY_7
public static final String SUBMIT
clickAndWait(String)
.
protected com.thoughtworks.selenium.Selenium selenium
Selenium
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.
Constructor Detail |
---|
public SeleniumTestCase()
Method Detail |
---|
public void testStartup(org.testng.ITestContext testContext, org.testng.xml.XmlTest xmlTest) throws Exception
tapestry.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 or TOMCAT_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 |
ITestContext
to see if the necessary keys are already present).
testContext
- Used to share objects between the launcher and the test suites
Exception
public void testShutdown(org.testng.ITestContext context)
testStartup(org.testng.ITestContext, org.testng.xml.XmlTest)
, this may
be called multiple times against multiple instances, but only does work the first time.
protected Runnable launchWebServer(String container, String webAppFolder, String contextPath, int port, int sslPort) throws Exception
testStartup(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.
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
Exception
public void setup(org.testng.ITestContext context)
public void cleanup()
protected void writeErrorReport(String reportText)
ErrorReporter#writeErrorReport(String)
to capture the current page markup in a
file for later analysis.
public String getBaseURL()
http://localhost:9999/
(i.e., it
includes a trailing slash).
Generally, you should use openLinks(String...)
to start from your application's home page.
public void indicateTestMethodName(Method testMethod)
public void cleanupTestMethod()
public void addCustomRequestHeader(String key, String value)
addCustomRequestHeader
in interface com.thoughtworks.selenium.Selenium
public void addLocationStrategy(String strategyName, String functionDefinition)
addLocationStrategy
in interface com.thoughtworks.selenium.Selenium
public void addScript(String scriptContent, String scriptTagId)
addScript
in interface com.thoughtworks.selenium.Selenium
public void addSelection(String locator, String optionLocator)
addSelection
in interface com.thoughtworks.selenium.Selenium
public void allowNativeXpath(String allow)
allowNativeXpath
in interface com.thoughtworks.selenium.Selenium
public void altKeyDown()
altKeyDown
in interface com.thoughtworks.selenium.Selenium
public void altKeyUp()
altKeyUp
in interface com.thoughtworks.selenium.Selenium
public void answerOnNextPrompt(String answer)
answerOnNextPrompt
in interface com.thoughtworks.selenium.Selenium
public void assignId(String locator, String identifier)
assignId
in interface com.thoughtworks.selenium.Selenium
public void attachFile(String fieldLocator, String fileLocator)
attachFile
in interface com.thoughtworks.selenium.Selenium
public void captureEntirePageScreenshot(String filename, String kwargs)
captureEntirePageScreenshot
in interface com.thoughtworks.selenium.Selenium
public String captureEntirePageScreenshotToString(String kwargs)
captureEntirePageScreenshotToString
in interface com.thoughtworks.selenium.Selenium
public String captureNetworkTraffic(String type)
captureNetworkTraffic
in interface com.thoughtworks.selenium.Selenium
public void captureScreenshot(String filename)
captureScreenshot
in interface com.thoughtworks.selenium.Selenium
public String captureScreenshotToString()
captureScreenshotToString
in interface com.thoughtworks.selenium.Selenium
public void check(String locator)
check
in interface com.thoughtworks.selenium.Selenium
public void chooseCancelOnNextConfirmation()
chooseCancelOnNextConfirmation
in interface com.thoughtworks.selenium.Selenium
public void chooseOkOnNextConfirmation()
chooseOkOnNextConfirmation
in interface com.thoughtworks.selenium.Selenium
public void click(String locator)
click
in interface com.thoughtworks.selenium.Selenium
public void clickAt(String locator, String coordString)
clickAt
in interface com.thoughtworks.selenium.Selenium
public void close()
close
in interface com.thoughtworks.selenium.Selenium
public void contextMenu(String locator)
contextMenu
in interface com.thoughtworks.selenium.Selenium
public void contextMenuAt(String locator, String coordString)
contextMenuAt
in interface com.thoughtworks.selenium.Selenium
public void controlKeyDown()
controlKeyDown
in interface com.thoughtworks.selenium.Selenium
public void controlKeyUp()
controlKeyUp
in interface com.thoughtworks.selenium.Selenium
public void createCookie(String nameValuePair, String optionsString)
createCookie
in interface com.thoughtworks.selenium.Selenium
public void deleteAllVisibleCookies()
deleteAllVisibleCookies
in interface com.thoughtworks.selenium.Selenium
public void deleteCookie(String name, String optionsString)
deleteCookie
in interface com.thoughtworks.selenium.Selenium
public void deselectPopUp()
deselectPopUp
in interface com.thoughtworks.selenium.Selenium
public void doubleClick(String locator)
doubleClick
in interface com.thoughtworks.selenium.Selenium
public void doubleClickAt(String locator, String coordString)
doubleClickAt
in interface com.thoughtworks.selenium.Selenium
public void dragAndDrop(String locator, String movementsString)
dragAndDrop
in interface com.thoughtworks.selenium.Selenium
public void dragAndDropToObject(String locatorOfObjectToBeDragged, String locatorOfDragDestinationObject)
dragAndDropToObject
in interface com.thoughtworks.selenium.Selenium
public void dragdrop(String locator, String movementsString)
dragdrop
in interface com.thoughtworks.selenium.Selenium
public void fireEvent(String locator, String eventName)
fireEvent
in interface com.thoughtworks.selenium.Selenium
public void focus(String locator)
focus
in interface com.thoughtworks.selenium.Selenium
public String getAlert()
getAlert
in interface com.thoughtworks.selenium.Selenium
public String[] getAllButtons()
getAllButtons
in interface com.thoughtworks.selenium.Selenium
public String[] getAllFields()
getAllFields
in interface com.thoughtworks.selenium.Selenium
public String[] getAllLinks()
getAllLinks
in interface com.thoughtworks.selenium.Selenium
public String[] getAllWindowIds()
getAllWindowIds
in interface com.thoughtworks.selenium.Selenium
public String[] getAllWindowNames()
getAllWindowNames
in interface com.thoughtworks.selenium.Selenium
public String[] getAllWindowTitles()
getAllWindowTitles
in interface com.thoughtworks.selenium.Selenium
public String getAttribute(String attributeLocator)
getAttribute
in interface com.thoughtworks.selenium.Selenium
public String[] getAttributeFromAllWindows(String attributeName)
getAttributeFromAllWindows
in interface com.thoughtworks.selenium.Selenium
public String getBodyText()
getBodyText
in interface com.thoughtworks.selenium.Selenium
public String getConfirmation()
getConfirmation
in interface com.thoughtworks.selenium.Selenium
public String getCookie()
getCookie
in interface com.thoughtworks.selenium.Selenium
public String getCookieByName(String name)
getCookieByName
in interface com.thoughtworks.selenium.Selenium
public Number getCursorPosition(String locator)
getCursorPosition
in interface com.thoughtworks.selenium.Selenium
public Number getElementHeight(String locator)
getElementHeight
in interface com.thoughtworks.selenium.Selenium
public Number getElementIndex(String locator)
getElementIndex
in interface com.thoughtworks.selenium.Selenium
public Number getElementPositionLeft(String locator)
getElementPositionLeft
in interface com.thoughtworks.selenium.Selenium
public Number getElementPositionTop(String locator)
getElementPositionTop
in interface com.thoughtworks.selenium.Selenium
public Number getElementWidth(String locator)
getElementWidth
in interface com.thoughtworks.selenium.Selenium
public String getEval(String script)
getEval
in interface com.thoughtworks.selenium.Selenium
public String getExpression(String expression)
getExpression
in interface com.thoughtworks.selenium.Selenium
public String getHtmlSource()
getHtmlSource
in interface com.thoughtworks.selenium.Selenium
public String getLocation()
getLocation
in interface com.thoughtworks.selenium.Selenium
public String getLog()
getLog
in interface com.thoughtworks.selenium.Selenium
public Number getMouseSpeed()
getMouseSpeed
in interface com.thoughtworks.selenium.Selenium
public String getPrompt()
getPrompt
in interface com.thoughtworks.selenium.Selenium
public String getSelectedId(String selectLocator)
getSelectedId
in interface com.thoughtworks.selenium.Selenium
public String[] getSelectedIds(String selectLocator)
getSelectedIds
in interface com.thoughtworks.selenium.Selenium
public String getSelectedIndex(String selectLocator)
getSelectedIndex
in interface com.thoughtworks.selenium.Selenium
public String[] getSelectedIndexes(String selectLocator)
getSelectedIndexes
in interface com.thoughtworks.selenium.Selenium
public String getSelectedLabel(String selectLocator)
getSelectedLabel
in interface com.thoughtworks.selenium.Selenium
public String[] getSelectedLabels(String selectLocator)
getSelectedLabels
in interface com.thoughtworks.selenium.Selenium
public String getSelectedValue(String selectLocator)
getSelectedValue
in interface com.thoughtworks.selenium.Selenium
public String[] getSelectedValues(String selectLocator)
getSelectedValues
in interface com.thoughtworks.selenium.Selenium
public String[] getSelectOptions(String selectLocator)
getSelectOptions
in interface com.thoughtworks.selenium.Selenium
public String getSpeed()
getSpeed
in interface com.thoughtworks.selenium.Selenium
public String getTable(String tableCellAddress)
getTable
in interface com.thoughtworks.selenium.Selenium
public String getText(String locator)
getText
in interface com.thoughtworks.selenium.Selenium
public String getTitle()
getTitle
in interface com.thoughtworks.selenium.Selenium
public String getValue(String locator)
getValue
in interface com.thoughtworks.selenium.Selenium
public boolean getWhetherThisFrameMatchFrameExpression(String currentFrameString, String target)
getWhetherThisFrameMatchFrameExpression
in interface com.thoughtworks.selenium.Selenium
public boolean getWhetherThisWindowMatchWindowExpression(String currentWindowString, String target)
getWhetherThisWindowMatchWindowExpression
in interface com.thoughtworks.selenium.Selenium
public Number getXpathCount(String xpath)
getXpathCount
in interface com.thoughtworks.selenium.Selenium
public void goBack()
goBack
in interface com.thoughtworks.selenium.Selenium
public void highlight(String locator)
highlight
in interface com.thoughtworks.selenium.Selenium
public void ignoreAttributesWithoutValue(String ignore)
ignoreAttributesWithoutValue
in interface com.thoughtworks.selenium.Selenium
public boolean isAlertPresent()
isAlertPresent
in interface com.thoughtworks.selenium.Selenium
public boolean isChecked(String locator)
isChecked
in interface com.thoughtworks.selenium.Selenium
public boolean isConfirmationPresent()
isConfirmationPresent
in interface com.thoughtworks.selenium.Selenium
public boolean isCookiePresent(String name)
isCookiePresent
in interface com.thoughtworks.selenium.Selenium
public boolean isEditable(String locator)
isEditable
in interface com.thoughtworks.selenium.Selenium
public boolean isElementPresent(String locator)
isElementPresent
in interface com.thoughtworks.selenium.Selenium
public boolean isOrdered(String locator1, String locator2)
isOrdered
in interface com.thoughtworks.selenium.Selenium
public boolean isPromptPresent()
isPromptPresent
in interface com.thoughtworks.selenium.Selenium
public boolean isSomethingSelected(String selectLocator)
isSomethingSelected
in interface com.thoughtworks.selenium.Selenium
public boolean isTextPresent(String pattern)
isTextPresent
in interface com.thoughtworks.selenium.Selenium
public boolean isVisible(String locator)
isVisible
in interface com.thoughtworks.selenium.Selenium
public void keyDown(String locator, String keySequence)
keyDown
in interface com.thoughtworks.selenium.Selenium
public void keyDownNative(String keycode)
keyDownNative
in interface com.thoughtworks.selenium.Selenium
public void keyPress(String locator, String keySequence)
keyPress
in interface com.thoughtworks.selenium.Selenium
public void keyPressNative(String keycode)
keyPressNative
in interface com.thoughtworks.selenium.Selenium
public void keyUp(String locator, String keySequence)
keyUp
in interface com.thoughtworks.selenium.Selenium
public void keyUpNative(String keycode)
keyUpNative
in interface com.thoughtworks.selenium.Selenium
public void metaKeyDown()
metaKeyDown
in interface com.thoughtworks.selenium.Selenium
public void metaKeyUp()
metaKeyUp
in interface com.thoughtworks.selenium.Selenium
public void mouseDown(String locator)
mouseDown
in interface com.thoughtworks.selenium.Selenium
public void mouseDownAt(String locator, String coordString)
mouseDownAt
in interface com.thoughtworks.selenium.Selenium
public void mouseDownRight(String locator)
mouseDownRight
in interface com.thoughtworks.selenium.Selenium
public void mouseDownRightAt(String locator, String coordString)
mouseDownRightAt
in interface com.thoughtworks.selenium.Selenium
public void mouseMove(String locator)
mouseMove
in interface com.thoughtworks.selenium.Selenium
public void mouseMoveAt(String locator, String coordString)
mouseMoveAt
in interface com.thoughtworks.selenium.Selenium
public void mouseOut(String locator)
mouseOut
in interface com.thoughtworks.selenium.Selenium
public void mouseOver(String locator)
mouseOver
in interface com.thoughtworks.selenium.Selenium
public void mouseUp(String locator)
mouseUp
in interface com.thoughtworks.selenium.Selenium
public void mouseUpAt(String locator, String coordString)
mouseUpAt
in interface com.thoughtworks.selenium.Selenium
public void mouseUpRight(String locator)
mouseUpRight
in interface com.thoughtworks.selenium.Selenium
public void mouseUpRightAt(String locator, String coordString)
mouseUpRightAt
in interface com.thoughtworks.selenium.Selenium
public void open(String url)
open
in interface com.thoughtworks.selenium.Selenium
public void open(String url, String ignoreResponseCode)
open
in interface com.thoughtworks.selenium.Selenium
public void openWindow(String url, String windowID)
openWindow
in interface com.thoughtworks.selenium.Selenium
public void refresh()
refresh
in interface com.thoughtworks.selenium.Selenium
public void removeAllSelections(String locator)
removeAllSelections
in interface com.thoughtworks.selenium.Selenium
public void removeScript(String scriptTagId)
removeScript
in interface com.thoughtworks.selenium.Selenium
public void removeSelection(String locator, String optionLocator)
removeSelection
in interface com.thoughtworks.selenium.Selenium
public String retrieveLastRemoteControlLogs()
retrieveLastRemoteControlLogs
in interface com.thoughtworks.selenium.Selenium
public void rollup(String rollupName, String kwargs)
rollup
in interface com.thoughtworks.selenium.Selenium
public void runScript(String script)
runScript
in interface com.thoughtworks.selenium.Selenium
public void select(String selectLocator, String optionLocator)
select
in interface com.thoughtworks.selenium.Selenium
public void selectFrame(String locator)
selectFrame
in interface com.thoughtworks.selenium.Selenium
public void selectPopUp(String windowID)
selectPopUp
in interface com.thoughtworks.selenium.Selenium
public void selectWindow(String windowID)
selectWindow
in interface com.thoughtworks.selenium.Selenium
public void setBrowserLogLevel(String logLevel)
setBrowserLogLevel
in interface com.thoughtworks.selenium.Selenium
public void setContext(String context)
setContext
in interface com.thoughtworks.selenium.Selenium
public void setCursorPosition(String locator, String position)
setCursorPosition
in interface com.thoughtworks.selenium.Selenium
public void setExtensionJs(String extensionJs)
setExtensionJs
in interface com.thoughtworks.selenium.Selenium
public void setMouseSpeed(String pixels)
setMouseSpeed
in interface com.thoughtworks.selenium.Selenium
public void setSpeed(String value)
setSpeed
in interface com.thoughtworks.selenium.Selenium
public void setTimeout(String timeout)
setTimeout
in interface com.thoughtworks.selenium.Selenium
public void shiftKeyDown()
shiftKeyDown
in interface com.thoughtworks.selenium.Selenium
public void shiftKeyUp()
shiftKeyUp
in interface com.thoughtworks.selenium.Selenium
public void showContextualBanner()
showContextualBanner
in interface com.thoughtworks.selenium.Selenium
public void showContextualBanner(String className, String methodName)
showContextualBanner
in interface com.thoughtworks.selenium.Selenium
public void shutDownSeleniumServer()
shutDownSeleniumServer
in interface com.thoughtworks.selenium.Selenium
public void start()
start
in interface com.thoughtworks.selenium.Selenium
public void start(Object optionsObject)
start
in interface com.thoughtworks.selenium.Selenium
public void start(String optionsString)
start
in interface com.thoughtworks.selenium.Selenium
public void stop()
stop
in interface com.thoughtworks.selenium.Selenium
public void submit(String formLocator)
submit
in interface com.thoughtworks.selenium.Selenium
public void type(String locator, String value)
type
in interface com.thoughtworks.selenium.Selenium
public void typeKeys(String locator, String value)
typeKeys
in interface com.thoughtworks.selenium.Selenium
public void uncheck(String locator)
uncheck
in interface com.thoughtworks.selenium.Selenium
public void useXpathLibrary(String libraryName)
useXpathLibrary
in interface com.thoughtworks.selenium.Selenium
public void waitForCondition(String script, String timeout)
waitForCondition
in interface com.thoughtworks.selenium.Selenium
public void waitForFrameToLoad(String frameAddress, String timeout)
waitForFrameToLoad
in interface com.thoughtworks.selenium.Selenium
public void waitForPageToLoad(String timeout)
waitForPageToLoad
in interface com.thoughtworks.selenium.Selenium
public void waitForPopUp(String windowID, String timeout)
waitForPopUp
in interface com.thoughtworks.selenium.Selenium
public void windowFocus()
windowFocus
in interface com.thoughtworks.selenium.Selenium
public void windowMaximize()
windowMaximize
in interface com.thoughtworks.selenium.Selenium
protected final void reportAndThrowAssertionError(String message, Object... arguments)
message
- arguments
- protected final void unreachable()
protected final void openBaseURL()
protected final void assertText(String locator, String expected)
locator
- identifies the element whose text value is to be assertedexpected
- expected value for the element's textprotected final void assertTextPresent(String... text)
protected final void assertSourcePresent(String... expected)
expected
- string expected to be presentprotected final void clickAndWait(String locator)
locator
- identifies the link to clickprotected final void waitForPageToLoad()
protected final void assertAttribute(String locator, String expected)
locator
- identifies the attribute whose value is to be assertedexpected
- expected value for the attributeprotected final void assertFieldValue(String locator, String expected)
locator
- identifies the fieldexpected
- expected value for the fieldprotected final void openLinks(String... linkText)
protected final void sleep(long millis)
protected void waitForCSSSelectedElementToAppear(String cssRule)
cssRule
- used to locate the elementprotected final void waitForElementToAppear(String elementId)
elementId
- identifies the elementprotected final void waitForElementToDisappear(String elementId)
elementId
- client-side id of elementprotected final void waitForVisible(String selector)
selector
- element selectorprotected final void waitForInvisible(String selector)
selector
- element selectorprotected final void assertTitle(String expected)
expected
- value for titleprotected final void waitForAjaxRequestsToComplete(String timeout)
timeout
- timeout to wait forpublic Number getCssCount(String str)
getCssCount
in interface com.thoughtworks.selenium.Selenium
protected final void waitForPageInitialized()
data-page-initialized
attribute
being added to the HTML element. Polls at 20ms intervals for 200ms.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |