|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.thoughtworks.selenium.DefaultSelenium
com.atlassian.selenium.SeleniumClient
public class SeleniumClient
Extends the DefaultSelenium client to provide a more sensible implementation
as well some extra utility methods such as keypress.
| Nested Class Summary | |
|---|---|
static class |
SeleniumClient.Browser
|
| Field Summary | |
|---|---|
protected long |
ACTION_WAIT
The maximum wait time for actions that don't require page loads. |
protected long |
PAGE_LOAD_WAIT
The maximum page load wait time used by Selenium. |
| Fields inherited from class com.thoughtworks.selenium.DefaultSelenium |
|---|
commandProcessor |
| Constructor Summary | |
|---|---|
SeleniumClient(SeleniumConfiguration config)
|
|
| Method Summary | |
|---|---|
void |
check(String name,
String value)
Checks a checkbox given a name and value. |
void |
click(String locator,
boolean waitForPageToLoad)
Click the element with the given locator and optionally wait for the page to load, using PAGE_LOAD_WAIT. |
void |
click(String locator,
long timeoutMillis)
Click the element with the given locator and wait for the page to load, for a maximum of timeoutMillis. |
void |
clickButton(String buttonText,
boolean waitForPageToLoad)
|
void |
clickButtonWithName(String buttonName,
boolean waitForPageToLoad)
|
void |
clickElementWithClass(String className)
|
void |
clickElementWithCss(String cssSelector)
|
void |
clickElementWithTitle(String title)
|
void |
clickElementWithXpath(String xpath)
|
void |
clickLinkWithText(String text,
boolean waitForPageToLoad)
|
SeleniumClient.Browser |
getBrowser()
|
void |
keyPress(String locator,
String key)
This will type into a field by sending key down / key press / key up events. |
void |
open(String url)
Unlike DefaultSelenium.open(java.lang.String), this opens the provided URL relative to the application context path. |
void |
open(String url,
long timeoutMillis)
Opens the given URL and waits a maximum of timeoutMillis for the page to load completely. |
void |
openNoWait(String url)
Wait for page to load doesn't work the case of non-HTML based resources (like images). |
void |
selectOption(String selectName,
String label)
|
void |
start()
|
void |
submit(String form,
boolean waitForPageToLoad)
Submit the named form locator and optionally wait for the page to load, using PAGE_LOAD_WAIT. |
void |
submit(String form,
long timeoutMillis)
Submit the given form and wait for the page to load, for a maximum of timeoutMillis. |
void |
typeInElementWithCss(String cssSelector,
String text)
|
void |
typeInElementWithName(String elementName,
String text)
|
void |
typeWithFullKeyEvents(String locator,
String string)
This will type into a field by first blanking it out and then sending key down / key press / key up events. |
void |
typeWithFullKeyEvents(String locator,
String string,
boolean reset)
This will type into a field by first blanking it out and then sending key down / key press / key up events. |
void |
waitForCondition(String javascript)
Executes the given Javascript in the context of the text page and waits for it to evaluate to true for a maximum of ACTION_WAIT milliseconds. |
void |
waitForCondition(String javascript,
long timeoutMillis)
Executes the given Javascript in the context of the text page and waits for it to evaluate to true for a maximum of timeoutMillis. |
void |
waitForPageToLoad()
Waits for the page to load with the default timeout configured in SeleniumConfiguration. |
void |
waitForPageToLoad(long timeoutMillis)
Overloads DefaultSelenium.waitForPageToLoad(String) to take in a long. |
| Methods inherited from class com.thoughtworks.selenium.DefaultSelenium |
|---|
addCustomRequestHeader, addLocationStrategy, addScript, addSelection, allowNativeXpath, altKeyDown, altKeyUp, answerOnNextPrompt, assignId, attachFile, captureEntirePageScreenshot, captureEntirePageScreenshotToString, captureNetworkTraffic, captureScreenshot, captureScreenshotToString, check, chooseCancelOnNextConfirmation, chooseOkOnNextConfirmation, click, clickAt, close, contextMenu, contextMenuAt, controlKeyDown, controlKeyUp, createCookie, deleteAllVisibleCookies, deleteCookie, deselectPopUp, doubleClick, doubleClickAt, dragAndDrop, dragAndDropToObject, dragdrop, fireEvent, focus, getAlert, getAllButtons, getAllFields, getAllLinks, getAllWindowIds, getAllWindowNames, getAllWindowTitles, getAttribute, getAttributeFromAllWindows, getBodyText, getConfirmation, getCookie, getCookieByName, getCursorPosition, getElementHeight, getElementIndex, getElementPositionLeft, getElementPositionTop, getElementWidth, getEval, getExpression, getHtmlSource, getLocation, getMouseSpeed, getPrompt, getSelectedId, getSelectedIds, getSelectedIndex, getSelectedIndexes, getSelectedLabel, getSelectedLabels, getSelectedValue, getSelectedValues, getSelectOptions, getSpeed, getTable, getText, getTitle, getValue, getWhetherThisFrameMatchFrameExpression, getWhetherThisWindowMatchWindowExpression, getXpathCount, goBack, highlight, ignoreAttributesWithoutValue, isAlertPresent, isChecked, isConfirmationPresent, isCookiePresent, isEditable, isElementPresent, isOrdered, isPromptPresent, isSomethingSelected, isTextPresent, isVisible, keyDown, keyDownNative, keyPressNative, keyUp, keyUpNative, metaKeyDown, metaKeyUp, mouseDown, mouseDownAt, mouseDownRight, mouseDownRightAt, mouseMove, mouseMoveAt, mouseOut, mouseOver, mouseUp, mouseUpAt, mouseUpRight, mouseUpRightAt, openWindow, refresh, removeAllSelections, removeScript, removeSelection, retrieveLastRemoteControlLogs, rollup, runScript, select, selectFrame, selectPopUp, selectWindow, setBrowserLogLevel, setContext, setCursorPosition, setExtensionJs, setMouseSpeed, setSpeed, setTimeout, shiftKeyDown, shiftKeyUp, showContextualBanner, showContextualBanner, shutDownSeleniumServer, start, start, stop, submit, type, typeKeys, uncheck, useXpathLibrary, waitForCondition, waitForFrameToLoad, waitForPageToLoad, waitForPopUp, windowFocus, windowMaximize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final long PAGE_LOAD_WAIT
SeleniumConfiguration.getPageLoadWait().
protected final long ACTION_WAIT
SeleniumConfiguration.getActionWait().
| Constructor Detail |
|---|
public SeleniumClient(SeleniumConfiguration config)
| Method Detail |
|---|
public SeleniumClient.Browser getBrowser()
public void open(String url)
DefaultSelenium.open(java.lang.String), this opens the provided URL relative to the application context path.
It also waits for the page to load -- a maximum of PAGE_LOAD_WAIT before returning.
open in interface com.thoughtworks.selenium.Seleniumopen in class com.thoughtworks.selenium.DefaultSeleniumpublic void openNoWait(String url)
url -
public void open(String url,
long timeoutMillis)
public void waitForPageToLoad(long timeoutMillis)
DefaultSelenium.waitForPageToLoad(String) to take in a long.
public void waitForPageToLoad()
SeleniumConfiguration.
public void waitForCondition(String javascript)
ACTION_WAIT milliseconds.
if you would like to specify your own timeout.
public void waitForCondition(String javascript,
long timeoutMillis)
public void click(String locator,
boolean waitForPageToLoad)
PAGE_LOAD_WAIT.
locator - the element to click, specified using Selenium selector syntaxwaitForPageToLoad - whether to wait for the page to reload. Don't use this unless the page is completely
reloaded.if you would like to specify your own timeout.
public void submit(String form,
boolean waitForPageToLoad)
PAGE_LOAD_WAIT.
form - to click, specified using Selenium selector syntaxwaitForPageToLoad - whether to wait for the page to reload. Don't use this unless the page is completely
reloaded.if you would like to specify your own timeout.
public void click(String locator,
long timeoutMillis)
locator - the element to click, specified using Selenium selector syntaxtimeoutMillis - the maximum number of milliseconds to wait for the page to load. Polling takes place
more frequently.if you would like to use the default timeout
public void submit(String form,
long timeoutMillis)
form - the form to submittimeoutMillis - the maximum number of milliseconds to wait for the page to load. Polling takes place
more frequently.if you would like to use the default timeout
public void keyPress(String locator,
String key)
keyPress in interface com.thoughtworks.selenium.SeleniumkeyPress in class com.thoughtworks.selenium.DefaultSeleniumlocator - Uses the Selenium locator syntaxkey - The key to be pressed
public void typeWithFullKeyEvents(String locator,
String string,
boolean reset)
locator - the Selenium locatorstring - the string to typereset - Should the field be reset first?
public void typeWithFullKeyEvents(String locator,
String string)
typeWithFullKeyEvents(String,String,boolean))}
locator - - the usual Selenium locatorstring - the string to type into a field
public void selectOption(String selectName,
String label)
public void check(String name,
String value)
public void clickLinkWithText(String text,
boolean waitForPageToLoad)
public void clickButton(String buttonText,
boolean waitForPageToLoad)
public void clickButtonWithName(String buttonName,
boolean waitForPageToLoad)
public void clickElementWithTitle(String title)
public void clickElementWithClass(String className)
public void clickElementWithCss(String cssSelector)
public void clickElementWithXpath(String xpath)
public void typeInElementWithName(String elementName,
String text)
public void typeInElementWithCss(String cssSelector,
String text)
public void start()
start in interface com.thoughtworks.selenium.Seleniumstart in class com.thoughtworks.selenium.DefaultSelenium
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||