public class ConfluenceSeleniumClient
extends com.atlassian.selenium.SingleBrowserSeleniumClient
Modifier and Type | Field and Description |
---|---|
static String |
UP_KEY |
static String |
WIKI_CONTENT_XPATH |
Modifier and Type | Method and Description |
---|---|
void |
check(String name,
String value)
Checks a checkbox given a name and value.
|
void |
cleanUp()
Resets the selenium client to a default state so that we can not slow down the tests run accidentally anymore.
|
void |
click(String locator,
boolean waitForPageToLoad) |
void |
click(String locator,
long timeoutMillis) |
void |
clickLinkWithTextInWikiContent(String text,
boolean waitForPageToLoad)
Clicks a link in the wiki content with the exact text given.
|
com.atlassian.selenium.Browser |
getBrowser() |
String |
getContextPath()
Context path, including initial slash, eg "/confluence".
|
String |
getEval(String javascript)
Runs the provided Javascript statement in the context of the test page, not the Selenium tester
like
DefaultSelenium.getEval(String) does. |
boolean |
getEvalAsBoolean(String javascript) |
String |
getEvalFunction(String... functionLines)
Varargs version of
getEvalFunction(String) which joins together its arguments with newlines. |
String |
getEvalFunction(String function)
Runs the provided Javascript function in the context of the test page.
|
static ConfluenceSeleniumClient |
getInstance() |
String |
getMetadata(String key) |
long |
getMetadataLong(String key) |
boolean |
hasSelectorWithText(String selector,
String text)
Returns true if the given JQuery selector returns at least one result containing the supplied text.
|
boolean |
isIE6Mode() |
boolean |
isJQueryElementSelectorPresent(String selector)
Returns true if the given JQuery selector returns at least one result.
|
void |
keyPressOnly(String locator,
String key) |
void |
open(String url,
long timeoutMillis)
Overridden to append the context path in front of the url.
|
void |
openAbsoluteURL(String url,
long timeoutMillis) |
void |
pressBackspace(String elementLocator)
Simulates pressing the backspace key in the element.
|
void |
pressCmdAltAndKey(String locator,
String keySequence) |
void |
pressCmdAndKey(String locator,
String keySequence) |
void |
pressCmdShiftAndKey(String locator,
String keySequence) |
void |
pressCtrlAltAndKey(String locator,
String keySequence)
Presses the control and alt keys, followed by the key(s) passed in
|
void |
pressCtrlAndKey(String locator,
String keySequence)
Presses the control key, followed by the key(s) passed in.
|
void |
pressCtrlShiftAndKey(String locator,
String keySequence)
Presses the control+shift keys, followed by the key(s) passed in.
|
void |
pressEnter(String elementLocator,
boolean waitForPageToLoad)
Simulates pressing the enter key in the element.
|
void |
pressEscape(String elementLocator)
Simulates pressing the Esc key in the element.
|
void |
pressShiftAndKey(String locator,
String keySequence) |
void |
selectTopFrame() |
void |
setScriptsFinishedPluginExpected(boolean expected) |
void |
submit(String form,
boolean waitForPageToLoad) |
void |
submit(String form,
boolean waitForPageToLoad,
boolean onlyFireEvent) |
void |
submit(String form,
long timeoutMillis) |
void |
typeInElementWithId(String elementId,
String text) |
void |
typeWithFullKeyEvents(String locator,
String string,
boolean reset) |
void |
typeWithLastCharFullKeyEvents(String locator,
String text)
Deprecated.
since 6.0. WARNING: This method has a bug where if the string's second last character is a space,
the space gets removed. It is recommended not to use this.
Use
typeWithFullKeyEvents(String, String, boolean) instead.} |
void |
waitForCondition(String javascript,
String timeoutMillis)
Runs the provided Javascript statement in the context of the test page, not the Selenium tester
like
DefaultSelenium.waitForCondition(String, String) does. |
void |
waitForFunction(String javascript) |
void |
waitForFunction(String javascript,
String timeoutMillis)
Runs the provided Javascript function in the context of the test page.
|
void |
waitForJQueryElementSelector(String selector)
Blocks until an element is found with the specified jQuery selector (or until the action timeout is reached).
|
void |
waitForJQueryElementSelector(String selector,
long timeoutMillis)
Blocks until an element is found with the specified jQuery selector (or until the given timeout is reached).
|
void |
waitForJQueryElementSelectorCount(String selector,
int count)
Blocks until a certain number of elements are found with the specified jQuery selector (or until the action
timeout is reached).
|
void |
waitForNoJQueryElementSelector(String selector) |
void |
waitForPageToLoad(long timeoutMillis) |
void |
waitForPageToLoad(String timeout)
Override to make sure all Javascript has finished loading before returning.
|
void |
waitForScriptsToLoad() |
void |
waitUntilFocused(String elementId)
Waits until the element with the supplied id has cursor focus or until the default timeout expires.
|
void |
waitUntilHiddenById(String elementId)
Waits until the element with the supplied id is hidden or until the default timeout expires.
|
void |
waitUntilRemoved(String selector)
Waits until the elements matched by the supplied selector are removed from the DOM.
|
void |
waitUntilVisible(String selector)
Waits until the element(s) matched by the supplied selector is visible or until the default timeout expires.
|
void |
waitUntilVisibleById(String elementId)
Waits until the element with the supplied id is visible or until the default timeout expires.
|
captureEntirePageScreenshot, clickAndWaitForAjaxWithJquery, clickAndWaitForAjaxWithJquery, clickButton, clickButtonAndWaitForAjaxWithJquery, clickButtonWithName, clickButtonWithNameAndWaitForAjaxWithJquery, clickElementWithClass, clickElementWithClassAndWaitForAjaxWithJquery, clickElementWithCss, clickElementWithCssAndWaitForAjaxWithJquery, clickElementWithTitle, clickElementWithTitleAndWaitForAjaxWithJquery, clickElementWithXpath, clickElementWithXpathAndWaitForAjaxWithJquery, clickLinkWithText, evaluate, execute, generateKeyEvent, getElementAtPoint, hasJquery, keyPress, open, openNoWait, refreshAndWait, resizeScreen, selectOption, selectOptionAndWaitForAjaxWithJquery, seleniumKeyPress, simulateKeyPressForCharacter, simulateKeyPressForCharacter, simulateKeyPressForSpecialKey, simulateKeyPressForSpecialKey, start, toggleToCharacterCode, toggleToKeyCode, typeInElementWithCss, typeInElementWithName, typeWithFullKeyEvents, waitForAjaxWithJquery, waitForAjaxWithJquery, waitForCondition, waitForCondition, waitForJQuery, waitForPageToLoad
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, getCssCount, getCursorPosition, getElementHeight, getElementIndex, getElementPositionLeft, getElementPositionTop, getElementWidth, getExpression, getHtmlSource, getLocation, getLog, 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, open, 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, waitForFrameToLoad, waitForPopUp, windowFocus, windowMaximize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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, getCssCount, getCursorPosition, getElementHeight, getElementIndex, getElementPositionLeft, getElementPositionTop, getElementWidth, getExpression, getHtmlSource, getLocation, getLog, 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, open, 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, waitForFrameToLoad, waitForPopUp, windowFocus, windowMaximize
public static final String WIKI_CONTENT_XPATH
public static final String UP_KEY
public com.atlassian.selenium.Browser getBrowser()
getBrowser
in interface com.atlassian.selenium.SeleniumClient
getBrowser
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public static ConfluenceSeleniumClient getInstance()
public void setScriptsFinishedPluginExpected(boolean expected)
public void selectTopFrame()
public void cleanUp()
public void open(String url, long timeoutMillis)
open
in interface com.atlassian.selenium.SeleniumClient
open
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void openAbsoluteURL(String url, long timeoutMillis)
public void waitForScriptsToLoad()
public void waitForPageToLoad(long timeoutMillis)
waitForPageToLoad
in interface com.atlassian.selenium.SeleniumClient
waitForPageToLoad
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void waitForPageToLoad(String timeout)
waitForPageToLoad
in interface com.thoughtworks.selenium.Selenium
waitForPageToLoad
in class com.thoughtworks.selenium.DefaultSelenium
public void waitForCondition(String javascript, String timeoutMillis)
DefaultSelenium.waitForCondition(String, String)
does. Use waitForFunction(String, String)
for executing more than one statement.waitForCondition
in interface com.thoughtworks.selenium.Selenium
waitForCondition
in class com.thoughtworks.selenium.DefaultSelenium
public void waitForFunction(String javascript, String timeoutMillis)
com.thoughtworks.selenium.SeleniumException
- a wrapped exception from selenium which indicates the condition that failed to run.public void waitForFunction(String javascript)
public void waitForJQueryElementSelector(String selector)
selector
- jQuery element selectorpublic void waitForJQueryElementSelector(String selector, long timeoutMillis)
selector
- jQuery element selectortimeoutMillis
- time to wait for the selector to find somethingpublic void waitForJQueryElementSelectorCount(String selector, int count)
selector
- jQuery element selectorcount
- the number of times the selector should be foundpublic boolean isJQueryElementSelectorPresent(String selector)
public boolean hasSelectorWithText(String selector, String text)
public void waitForNoJQueryElementSelector(String selector)
public boolean getEvalAsBoolean(String javascript)
public String getEval(String javascript)
DefaultSelenium.getEval(String)
does. Use getEvalFunction(String)
for
executing more than one statement.getEval
in interface com.thoughtworks.selenium.Selenium
getEval
in class com.thoughtworks.selenium.DefaultSelenium
public String getEvalFunction(String function)
function
- a javascript function body including the return statementpublic String getEvalFunction(String... functionLines)
getEvalFunction(String)
which joins together its arguments with newlines.public void typeWithFullKeyEvents(String locator, String string, boolean reset)
typeWithFullKeyEvents
in interface com.atlassian.selenium.SeleniumClient
typeWithFullKeyEvents
in class com.atlassian.selenium.SingleBrowserSeleniumClient
@Deprecated public void typeWithLastCharFullKeyEvents(String locator, String text)
typeWithFullKeyEvents(String, String, boolean)
instead.}This method has been introduced to reduce flakiness in FF on BEAC where all the keys aren't always typed into the field (according to screenshots).
public void waitUntilRemoved(String selector)
public void waitUntilHiddenById(String elementId)
public void waitUntilVisible(String selector)
public void waitUntilVisibleById(String elementId)
public void waitUntilFocused(String elementId)
public void pressBackspace(String elementLocator)
public void pressEnter(String elementLocator, boolean waitForPageToLoad)
Note, this method does not work for submitting forms.
public void pressEscape(String elementLocator)
public void pressCtrlAndKey(String locator, String keySequence)
public void pressCtrlAltAndKey(String locator, String keySequence)
public void pressCtrlShiftAndKey(String locator, String keySequence)
public String getContextPath()
public boolean isIE6Mode()
public void check(String name, String value)
Overrides the default implementation which doesn't work when the value has spaces (see SEL-270).
check
in interface com.atlassian.selenium.SeleniumClient
check
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void click(String locator, long timeoutMillis)
click
in interface com.atlassian.selenium.SeleniumClient
click
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void click(String locator, boolean waitForPageToLoad)
click
in interface com.atlassian.selenium.SeleniumClient
click
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void clickLinkWithTextInWikiContent(String text, boolean waitForPageToLoad)
public void submit(String form, long timeoutMillis)
submit
in interface com.atlassian.selenium.SeleniumClient
submit
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void submit(String form, boolean waitForPageToLoad)
submit
in interface com.atlassian.selenium.SeleniumClient
submit
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void submit(String form, boolean waitForPageToLoad, boolean onlyFireEvent)
public long getMetadataLong(String key)
Copyright © 2003–2017 Atlassian. All rights reserved.