com.atlassian.selenium.mock
Class MockSeleniumClient

java.lang.Object
  extended by com.atlassian.selenium.mock.MockSeleniumClient
All Implemented Interfaces:
SeleniumClient, VisualComparableClient, com.thoughtworks.selenium.Selenium

public class MockSeleniumClient
extends Object
implements SeleniumClient

Mock implementation of the SeleniumClient interface.

Probably the longest mock-that-does-nothing in the history of software.

Since:
v1.21

Constructor Summary
MockSeleniumClient()
           
 
Method Summary
 void addCustomRequestHeader(String s, String s1)
           
 void addLocationStrategy(String s, String s1)
           
 MockSeleniumClient addPresentElements(String... elements)
           
 void addScript(String s, String s1)
           
 MockSeleniumClient addScriptResult(String script, String result)
           
 void addSelection(String s, String s1)
           
 void allowNativeXpath(String s)
           
 void altKeyDown()
           
 void altKeyUp()
           
 void answerOnNextPrompt(String s)
           
 void assignId(String s, String s1)
           
 void attachFile(String s, String s1)
           
 void captureEntirePageScreenshot(String filePath)
           
 void captureEntirePageScreenshot(String s, String s1)
           
 String captureEntirePageScreenshotToString(String s)
           
 String captureNetworkTraffic(String s)
           
 void captureScreenshot(String s)
           
 String captureScreenshotToString()
           
 void check(String s)
           
 void check(String name, String value)
          Checks a checkbox given a name and value.
 void chooseCancelOnNextConfirmation()
           
 void chooseOkOnNextConfirmation()
           
 void click(String s)
           
 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 clickAndWaitForAjaxWithJquery(String locator)
          Click the element with the given locator and wait for the ajax call to finish.
 void clickAndWaitForAjaxWithJquery(String locator, long timeoutMillis)
          Click the element with the given locator and wait for the ajax call to finish.
 void clickAt(String s, String s1)
           
 void clickButton(String buttonText, boolean waitForPageToLoad)
           
 void clickButtonAndWaitForAjaxWithJquery(String buttonText)
           
 void clickButtonWithName(String buttonName, boolean waitForPageToLoad)
           
 void clickButtonWithNameAndWaitForAjaxWithJquery(String buttonName)
           
 void clickElementWithClass(String className)
           
 void clickElementWithClassAndWaitForAjaxWithJquery(String className)
           
 void clickElementWithCss(String cssSelector)
           
 void clickElementWithCssAndWaitForAjaxWithJquery(String cssSelector)
           
 void clickElementWithTitle(String title)
           
 void clickElementWithTitleAndWaitForAjaxWithJquery(String title)
           
 void clickElementWithXpath(String xpath)
           
 void clickElementWithXpathAndWaitForAjaxWithJquery(String xpath)
           
 void clickLinkWithText(String text, boolean waitForPageToLoad)
           
 void close()
           
 void contextMenu(String s)
           
 void contextMenuAt(String s, String s1)
           
 void controlKeyDown()
           
 void controlKeyUp()
           
 void createCookie(String s, String s1)
           
 void deleteAllVisibleCookies()
           
 void deleteCookie(String s, String s1)
           
 void deselectPopUp()
           
 void doubleClick(String s)
           
 void doubleClickAt(String s, String s1)
           
 void dragAndDrop(String s, String s1)
           
 void dragAndDropToObject(String s, String s1)
           
 void dragdrop(String s, String s1)
           
 void evaluate(String command)
          Execute a script in the client.
 Object execute(String command, Object... arguments)
          Execute a script in the client and return the evaluated result.
 List<String> executedScripts()
           
 void fireEvent(String s, String s1)
           
 void focus(String s)
           
 void generateKeyEvent(String locator, KeyEventType eventType, int keyCode, int characterCode, boolean shiftKey, boolean altKey, boolean controlKey, boolean metaKey)
          This is a low level function to generate one keyboard event.
 MockSeleniumClient genericScriptResult(String result)
           
 String getAlert()
           
 String[] getAllButtons()
           
 String[] getAllFields()
           
 String[] getAllLinks()
           
 String[] getAllWindowIds()
           
 String[] getAllWindowNames()
           
 String[] getAllWindowTitles()
           
 String getAttribute(String s)
           
 String[] getAttributeFromAllWindows(String s)
           
 String getBodyText()
           
 Browser getBrowser()
           
 String getConfirmation()
           
 String getCookie()
           
 String getCookieByName(String s)
           
 Number getCssCount(String css)
           
 Number getCursorPosition(String s)
           
 ScreenElement getElementAtPoint(int x, int y)
           
 Number getElementHeight(String s)
           
 Number getElementIndex(String s)
           
 Number getElementPositionLeft(String s)
           
 Number getElementPositionTop(String s)
           
 Number getElementWidth(String s)
           
 String getEval(String script)
           
 String getExpression(String s)
           
 String getHtmlSource()
           
 String getLocation()
           
 String getLog()
           
 Number getMouseSpeed()
           
 String getPrompt()
           
 String getSelectedId(String s)
           
 String[] getSelectedIds(String s)
           
 String getSelectedIndex(String s)
           
 String[] getSelectedIndexes(String s)
           
 String getSelectedLabel(String s)
           
 String[] getSelectedLabels(String s)
           
 String getSelectedValue(String s)
           
 String[] getSelectedValues(String s)
           
 String[] getSelectOptions(String s)
           
 String getSpeed()
           
 String getTable(String s)
           
 String getText(String s)
           
 String getTitle()
           
 String getValue(String s)
           
 boolean getWhetherThisFrameMatchFrameExpression(String s, String s1)
           
 boolean getWhetherThisWindowMatchWindowExpression(String s, String s1)
           
 Number getXpathCount(String s)
           
 void goBack()
           
 boolean hasJquery()
           
 void highlight(String s)
           
 void ignoreAttributesWithoutValue(String s)
           
 boolean isAlertPresent()
           
 boolean isChecked(String s)
           
 boolean isConfirmationPresent()
           
 boolean isCookiePresent(String s)
           
 boolean isEditable(String s)
           
 boolean isElementPresent(String elemLocator)
           
 boolean isOrdered(String s, String s1)
           
 boolean isPromptPresent()
           
 boolean isSomethingSelected(String s)
           
 boolean isTextPresent(String s)
           
 boolean isVisible(String s)
           
 void keyDown(String s, String s1)
           
 void keyDownNative(String s)
           
 void keyPress(String locator, String key)
          This will type into a field by sending key down / key press / key up events.
 void keyPressNative(String s)
           
 void keyUp(String s, String s1)
           
 void keyUpNative(String s)
           
 void metaKeyDown()
           
 void metaKeyUp()
           
 void mouseDown(String s)
           
 void mouseDownAt(String s, String s1)
           
 void mouseDownRight(String s)
           
 void mouseDownRightAt(String s, String s1)
           
 void mouseMove(String s)
           
 void mouseMoveAt(String s, String s1)
           
 void mouseOut(String s)
           
 void mouseOver(String s)
           
 void mouseUp(String s)
           
 void mouseUpAt(String s, String s1)
           
 void mouseUpRight(String s)
           
 void mouseUpRightAt(String s, String s1)
           
 void open(String url)
          Unlike DefaultSelenium#open, 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 open(String s, String s1)
           
 void openNoWait(String url)
          Wait for page to load doesn't work the case of non-HTML based resources (like images).
 void openWindow(String s, String s1)
           
 void refresh()
           
 void refreshAndWait()
           
 void removeAllSelections(String s)
           
 void removeScript(String s)
           
 void removeSelection(String s, String s1)
           
 boolean resizeScreen(ScreenResolution resolution, boolean refreshAfterResize)
           
 String retrieveLastRemoteControlLogs()
           
 void rollup(String s, String s1)
           
 void runScript(String s)
           
 void select(String s, String s1)
           
 void selectFrame(String s)
           
 void selectOption(String selectName, String label)
          This will select an option from a select field.
 void selectOptionAndWaitForAjaxWithJquery(String selectName, String label)
          This will select an option from a select field.
 void selectPopUp(String s)
           
 void selectWindow(String s)
           
 void seleniumKeyPress(String locator, String key)
           
 void setBrowserLogLevel(String s)
           
 void setContext(String s)
           
 void setCursorPosition(String s, String s1)
           
 void setExtensionJs(String s)
           
 void setMouseSpeed(String s)
           
 void setSpeed(String s)
           
 void setTimeout(String s)
           
 void shiftKeyDown()
           
 void shiftKeyUp()
           
 void showContextualBanner()
           
 void showContextualBanner(String s, String s1)
           
 void shutDownSeleniumServer()
           
 void simulateKeyPressForCharacter(String s, Character character)
          This will send all the events for a particular character NOTE: This function will only handle vanilla ascii characters more exotic characters will be ignored (ie.
 void simulateKeyPressForCharacter(String locator, Character character, Collection<KeyEventType> eventsToFire)
          This will send all the events for a particular character NOTE: This function will only handle vanilla ascii characters more exotic characters will be ignored (ie.
 void simulateKeyPressForSpecialKey(String s, int i)
          This will send all the events for a particular special key (for example F1 or the down arrow key) The keyCode matches the codes in java.awt.event.KeyEvent NOTE: the return key actually fires events with a keyCode of 13 NOT VK_ENTER This will fire ALL events for the special key.
 void simulateKeyPressForSpecialKey(String locator, int keyCode, Collection<KeyEventType> eventsToFire)
          This will send all the events for a particular special key (for example F1 or the down arrow key) The keyCode matches the codes in java.awt.event.KeyEvent NOTE: the return key actually fires events with a keyCode of 13 NOT VK_ENTER *
 void start()
           
 void start(Object o)
           
 void start(String s)
           
 void stop()
           
 void submit(String s)
           
 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 toggleToCharacterCode(boolean b)
          This sets if subsiquent calls to the keyEvent (@keyDown, @keyPress, @keyUp) fuctions will set the code in the characterCode or not.
 void toggleToKeyCode(boolean b)
          This sets if subsiquent calls to the keyEvent (@keyDown, @keyPress, @keyUp) fuctions will set the code in the keyCode or not.
 void type(String s, String s1)
           
 void typeInElementWithCss(String cssSelector, String text)
           
 void typeInElementWithName(String elementName, String text)
           
 void typeKeys(String s, String s1)
           
 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 uncheck(String s)
           
 void useXpathLibrary(String s)
           
 void waitForAjaxWithJquery()
          Waits for the page to finish loading ajax calls, and returns if there are no more ajax calls currently running.
 void waitForAjaxWithJquery(long timeoutMillis)
          Waits for the page to finish loading ajax calls, and returns if there are no more ajax calls currently running.
 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 SeleniumConfiguration.getActionWait 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 waitForCondition(String s, String s1)
           
 void waitForFrameToLoad(String s, String s1)
           
 boolean waitForJQuery(long waitTimeMillis)
          Wait until all active jQuery AJAX queries have returned -- i.e., no AJAX queries are active.
 void waitForPageToLoad()
          Waits for the page to load with the default timeout configured in SeleniumConfiguration.
 void waitForPageToLoad(long timeoutMillis)
          Overloads Selenium.waitForPageToLoad(String) to take in a long.
 void waitForPageToLoad(String s)
           
 void waitForPopUp(String s, String s1)
           
 void windowFocus()
           
 void windowMaximize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockSeleniumClient

public MockSeleniumClient()
Method Detail

open

public void open(String url)
Description copied from interface: SeleniumClient
Unlike DefaultSelenium#open, 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.

Specified by:
open in interface SeleniumClient
Specified by:
open in interface com.thoughtworks.selenium.Selenium

openWindow

public void openWindow(String s,
                       String s1)
Specified by:
openWindow in interface com.thoughtworks.selenium.Selenium

selectWindow

public void selectWindow(String s)
Specified by:
selectWindow in interface com.thoughtworks.selenium.Selenium

selectPopUp

public void selectPopUp(String s)
Specified by:
selectPopUp in interface com.thoughtworks.selenium.Selenium

deselectPopUp

public void deselectPopUp()
Specified by:
deselectPopUp in interface com.thoughtworks.selenium.Selenium

selectFrame

public void selectFrame(String s)
Specified by:
selectFrame in interface com.thoughtworks.selenium.Selenium

getWhetherThisFrameMatchFrameExpression

public boolean getWhetherThisFrameMatchFrameExpression(String s,
                                                       String s1)
Specified by:
getWhetherThisFrameMatchFrameExpression in interface com.thoughtworks.selenium.Selenium

getWhetherThisWindowMatchWindowExpression

public boolean getWhetherThisWindowMatchWindowExpression(String s,
                                                         String s1)
Specified by:
getWhetherThisWindowMatchWindowExpression in interface com.thoughtworks.selenium.Selenium

waitForPopUp

public void waitForPopUp(String s,
                         String s1)
Specified by:
waitForPopUp in interface com.thoughtworks.selenium.Selenium

chooseCancelOnNextConfirmation

public void chooseCancelOnNextConfirmation()
Specified by:
chooseCancelOnNextConfirmation in interface com.thoughtworks.selenium.Selenium

chooseOkOnNextConfirmation

public void chooseOkOnNextConfirmation()
Specified by:
chooseOkOnNextConfirmation in interface com.thoughtworks.selenium.Selenium

answerOnNextPrompt

public void answerOnNextPrompt(String s)
Specified by:
answerOnNextPrompt in interface com.thoughtworks.selenium.Selenium

goBack

public void goBack()
Specified by:
goBack in interface com.thoughtworks.selenium.Selenium

refresh

public void refresh()
Specified by:
refresh in interface com.thoughtworks.selenium.Selenium

close

public void close()
Specified by:
close in interface com.thoughtworks.selenium.Selenium

isAlertPresent

public boolean isAlertPresent()
Specified by:
isAlertPresent in interface com.thoughtworks.selenium.Selenium

isPromptPresent

public boolean isPromptPresent()
Specified by:
isPromptPresent in interface com.thoughtworks.selenium.Selenium

isConfirmationPresent

public boolean isConfirmationPresent()
Specified by:
isConfirmationPresent in interface com.thoughtworks.selenium.Selenium

getAlert

public String getAlert()
Specified by:
getAlert in interface com.thoughtworks.selenium.Selenium

getConfirmation

public String getConfirmation()
Specified by:
getConfirmation in interface com.thoughtworks.selenium.Selenium

getPrompt

public String getPrompt()
Specified by:
getPrompt in interface com.thoughtworks.selenium.Selenium

getLocation

public String getLocation()
Specified by:
getLocation in interface com.thoughtworks.selenium.Selenium

getTitle

public String getTitle()
Specified by:
getTitle in interface com.thoughtworks.selenium.Selenium

getBodyText

public String getBodyText()
Specified by:
getBodyText in interface com.thoughtworks.selenium.Selenium

getValue

public String getValue(String s)
Specified by:
getValue in interface com.thoughtworks.selenium.Selenium

getText

public String getText(String s)
Specified by:
getText in interface com.thoughtworks.selenium.Selenium

highlight

public void highlight(String s)
Specified by:
highlight in interface com.thoughtworks.selenium.Selenium

getEval

public String getEval(String script)
Specified by:
getEval in interface com.thoughtworks.selenium.Selenium

addScriptResult

public MockSeleniumClient addScriptResult(String script,
                                          String result)

genericScriptResult

public MockSeleniumClient genericScriptResult(String result)

executedScripts

public List<String> executedScripts()

isChecked

public boolean isChecked(String s)
Specified by:
isChecked in interface com.thoughtworks.selenium.Selenium

getTable

public String getTable(String s)
Specified by:
getTable in interface com.thoughtworks.selenium.Selenium

getSelectedLabels

public String[] getSelectedLabels(String s)
Specified by:
getSelectedLabels in interface com.thoughtworks.selenium.Selenium

getSelectedLabel

public String getSelectedLabel(String s)
Specified by:
getSelectedLabel in interface com.thoughtworks.selenium.Selenium

getSelectedValues

public String[] getSelectedValues(String s)
Specified by:
getSelectedValues in interface com.thoughtworks.selenium.Selenium

getSelectedValue

public String getSelectedValue(String s)
Specified by:
getSelectedValue in interface com.thoughtworks.selenium.Selenium

getSelectedIndexes

public String[] getSelectedIndexes(String s)
Specified by:
getSelectedIndexes in interface com.thoughtworks.selenium.Selenium

getSelectedIndex

public String getSelectedIndex(String s)
Specified by:
getSelectedIndex in interface com.thoughtworks.selenium.Selenium

getSelectedIds

public String[] getSelectedIds(String s)
Specified by:
getSelectedIds in interface com.thoughtworks.selenium.Selenium

getSelectedId

public String getSelectedId(String s)
Specified by:
getSelectedId in interface com.thoughtworks.selenium.Selenium

isSomethingSelected

public boolean isSomethingSelected(String s)
Specified by:
isSomethingSelected in interface com.thoughtworks.selenium.Selenium

getSelectOptions

public String[] getSelectOptions(String s)
Specified by:
getSelectOptions in interface com.thoughtworks.selenium.Selenium

getAttribute

public String getAttribute(String s)
Specified by:
getAttribute in interface com.thoughtworks.selenium.Selenium

isTextPresent

public boolean isTextPresent(String s)
Specified by:
isTextPresent in interface com.thoughtworks.selenium.Selenium

isElementPresent

public boolean isElementPresent(String elemLocator)
Specified by:
isElementPresent in interface com.thoughtworks.selenium.Selenium

addPresentElements

public MockSeleniumClient addPresentElements(String... elements)

isVisible

public boolean isVisible(String s)
Specified by:
isVisible in interface com.thoughtworks.selenium.Selenium

isEditable

public boolean isEditable(String s)
Specified by:
isEditable in interface com.thoughtworks.selenium.Selenium

getAllButtons

public String[] getAllButtons()
Specified by:
getAllButtons in interface com.thoughtworks.selenium.Selenium

getAllLinks

public String[] getAllLinks()
Specified by:
getAllLinks in interface com.thoughtworks.selenium.Selenium

getAllFields

public String[] getAllFields()
Specified by:
getAllFields in interface com.thoughtworks.selenium.Selenium

getAttributeFromAllWindows

public String[] getAttributeFromAllWindows(String s)
Specified by:
getAttributeFromAllWindows in interface com.thoughtworks.selenium.Selenium

dragdrop

public void dragdrop(String s,
                     String s1)
Specified by:
dragdrop in interface com.thoughtworks.selenium.Selenium

setMouseSpeed

public void setMouseSpeed(String s)
Specified by:
setMouseSpeed in interface com.thoughtworks.selenium.Selenium

getMouseSpeed

public Number getMouseSpeed()
Specified by:
getMouseSpeed in interface com.thoughtworks.selenium.Selenium

dragAndDrop

public void dragAndDrop(String s,
                        String s1)
Specified by:
dragAndDrop in interface com.thoughtworks.selenium.Selenium

dragAndDropToObject

public void dragAndDropToObject(String s,
                                String s1)
Specified by:
dragAndDropToObject in interface com.thoughtworks.selenium.Selenium

windowFocus

public void windowFocus()
Specified by:
windowFocus in interface com.thoughtworks.selenium.Selenium

windowMaximize

public void windowMaximize()
Specified by:
windowMaximize in interface com.thoughtworks.selenium.Selenium

getAllWindowIds

public String[] getAllWindowIds()
Specified by:
getAllWindowIds in interface com.thoughtworks.selenium.Selenium

getAllWindowNames

public String[] getAllWindowNames()
Specified by:
getAllWindowNames in interface com.thoughtworks.selenium.Selenium

getAllWindowTitles

public String[] getAllWindowTitles()
Specified by:
getAllWindowTitles in interface com.thoughtworks.selenium.Selenium

getHtmlSource

public String getHtmlSource()
Specified by:
getHtmlSource in interface com.thoughtworks.selenium.Selenium

setCursorPosition

public void setCursorPosition(String s,
                              String s1)
Specified by:
setCursorPosition in interface com.thoughtworks.selenium.Selenium

getElementIndex

public Number getElementIndex(String s)
Specified by:
getElementIndex in interface com.thoughtworks.selenium.Selenium

isOrdered

public boolean isOrdered(String s,
                         String s1)
Specified by:
isOrdered in interface com.thoughtworks.selenium.Selenium

getElementPositionLeft

public Number getElementPositionLeft(String s)
Specified by:
getElementPositionLeft in interface com.thoughtworks.selenium.Selenium

getElementPositionTop

public Number getElementPositionTop(String s)
Specified by:
getElementPositionTop in interface com.thoughtworks.selenium.Selenium

getElementWidth

public Number getElementWidth(String s)
Specified by:
getElementWidth in interface com.thoughtworks.selenium.Selenium

getElementHeight

public Number getElementHeight(String s)
Specified by:
getElementHeight in interface com.thoughtworks.selenium.Selenium

getCursorPosition

public Number getCursorPosition(String s)
Specified by:
getCursorPosition in interface com.thoughtworks.selenium.Selenium

getExpression

public String getExpression(String s)
Specified by:
getExpression in interface com.thoughtworks.selenium.Selenium

getXpathCount

public Number getXpathCount(String s)
Specified by:
getXpathCount in interface com.thoughtworks.selenium.Selenium

getCssCount

public Number getCssCount(String css)
Specified by:
getCssCount in interface com.thoughtworks.selenium.Selenium

assignId

public void assignId(String s,
                     String s1)
Specified by:
assignId in interface com.thoughtworks.selenium.Selenium

allowNativeXpath

public void allowNativeXpath(String s)
Specified by:
allowNativeXpath in interface com.thoughtworks.selenium.Selenium

ignoreAttributesWithoutValue

public void ignoreAttributesWithoutValue(String s)
Specified by:
ignoreAttributesWithoutValue in interface com.thoughtworks.selenium.Selenium

waitForCondition

public void waitForCondition(String s,
                             String s1)
Specified by:
waitForCondition in interface com.thoughtworks.selenium.Selenium

setTimeout

public void setTimeout(String s)
Specified by:
setTimeout in interface com.thoughtworks.selenium.Selenium

waitForPageToLoad

public void waitForPageToLoad(String s)
Specified by:
waitForPageToLoad in interface com.thoughtworks.selenium.Selenium

waitForFrameToLoad

public void waitForFrameToLoad(String s,
                               String s1)
Specified by:
waitForFrameToLoad in interface com.thoughtworks.selenium.Selenium

getCookie

public String getCookie()
Specified by:
getCookie in interface com.thoughtworks.selenium.Selenium

getCookieByName

public String getCookieByName(String s)
Specified by:
getCookieByName in interface com.thoughtworks.selenium.Selenium

isCookiePresent

public boolean isCookiePresent(String s)
Specified by:
isCookiePresent in interface com.thoughtworks.selenium.Selenium

createCookie

public void createCookie(String s,
                         String s1)
Specified by:
createCookie in interface com.thoughtworks.selenium.Selenium

deleteCookie

public void deleteCookie(String s,
                         String s1)
Specified by:
deleteCookie in interface com.thoughtworks.selenium.Selenium

deleteAllVisibleCookies

public void deleteAllVisibleCookies()
Specified by:
deleteAllVisibleCookies in interface com.thoughtworks.selenium.Selenium

setBrowserLogLevel

public void setBrowserLogLevel(String s)
Specified by:
setBrowserLogLevel in interface com.thoughtworks.selenium.Selenium

runScript

public void runScript(String s)
Specified by:
runScript in interface com.thoughtworks.selenium.Selenium

addLocationStrategy

public void addLocationStrategy(String s,
                                String s1)
Specified by:
addLocationStrategy in interface com.thoughtworks.selenium.Selenium

captureEntirePageScreenshot

public void captureEntirePageScreenshot(String s,
                                        String s1)
Specified by:
captureEntirePageScreenshot in interface com.thoughtworks.selenium.Selenium

rollup

public void rollup(String s,
                   String s1)
Specified by:
rollup in interface com.thoughtworks.selenium.Selenium

addScript

public void addScript(String s,
                      String s1)
Specified by:
addScript in interface com.thoughtworks.selenium.Selenium

removeScript

public void removeScript(String s)
Specified by:
removeScript in interface com.thoughtworks.selenium.Selenium

useXpathLibrary

public void useXpathLibrary(String s)
Specified by:
useXpathLibrary in interface com.thoughtworks.selenium.Selenium

setContext

public void setContext(String s)
Specified by:
setContext in interface com.thoughtworks.selenium.Selenium

attachFile

public void attachFile(String s,
                       String s1)
Specified by:
attachFile in interface com.thoughtworks.selenium.Selenium

captureScreenshot

public void captureScreenshot(String s)
Specified by:
captureScreenshot in interface com.thoughtworks.selenium.Selenium

captureScreenshotToString

public String captureScreenshotToString()
Specified by:
captureScreenshotToString in interface com.thoughtworks.selenium.Selenium

captureNetworkTraffic

public String captureNetworkTraffic(String s)
Specified by:
captureNetworkTraffic in interface com.thoughtworks.selenium.Selenium

addCustomRequestHeader

public void addCustomRequestHeader(String s,
                                   String s1)
Specified by:
addCustomRequestHeader in interface com.thoughtworks.selenium.Selenium

captureEntirePageScreenshotToString

public String captureEntirePageScreenshotToString(String s)
Specified by:
captureEntirePageScreenshotToString in interface com.thoughtworks.selenium.Selenium

shutDownSeleniumServer

public void shutDownSeleniumServer()
Specified by:
shutDownSeleniumServer in interface com.thoughtworks.selenium.Selenium

retrieveLastRemoteControlLogs

public String retrieveLastRemoteControlLogs()
Specified by:
retrieveLastRemoteControlLogs in interface com.thoughtworks.selenium.Selenium

keyDownNative

public void keyDownNative(String s)
Specified by:
keyDownNative in interface com.thoughtworks.selenium.Selenium

keyUpNative

public void keyUpNative(String s)
Specified by:
keyUpNative in interface com.thoughtworks.selenium.Selenium

keyPressNative

public void keyPressNative(String s)
Specified by:
keyPressNative in interface com.thoughtworks.selenium.Selenium

openNoWait

public void openNoWait(String url)
Description copied from interface: SeleniumClient
Wait for page to load doesn't work the case of non-HTML based resources (like images). So sometimes you really do want to open a url without waiting.

Specified by:
openNoWait in interface SeleniumClient

open

public void open(String url,
                 long timeoutMillis)
Description copied from interface: SeleniumClient
Opens the given URL and waits a maximum of timeoutMillis for the page to load completely.

Specified by:
open in interface SeleniumClient

waitForPageToLoad

public void waitForPageToLoad(long timeoutMillis)
Description copied from interface: SeleniumClient
Overloads Selenium.waitForPageToLoad(String) to take in a long.

Specified by:
waitForPageToLoad in interface SeleniumClient

waitForPageToLoad

public void waitForPageToLoad()
Description copied from interface: SeleniumClient
Waits for the page to load with the default timeout configured in SeleniumConfiguration.

Specified by:
waitForPageToLoad in interface SeleniumClient

waitForCondition

public void waitForCondition(String javascript)
Description copied from interface: SeleniumClient
Executes the given Javascript in the context of the text page and waits for it to evaluate to true for a maximum of SeleniumConfiguration.getActionWait milliseconds.

Specified by:
waitForCondition in interface SeleniumClient
See Also:
if you would like to specify your own timeout.

waitForCondition

public void waitForCondition(String javascript,
                             long timeoutMillis)
Description copied from interface: SeleniumClient
Executes the given Javascript in the context of the text page and waits for it to evaluate to true for a maximum of timeoutMillis.

Specified by:
waitForCondition in interface SeleniumClient

waitForAjaxWithJquery

public void waitForAjaxWithJquery()
Description copied from interface: SeleniumClient
Waits for the page to finish loading ajax calls, and returns if there are no more ajax calls currently running. The method will check for a maximum of #ACTION_WAIT milliseconds

Specified by:
waitForAjaxWithJquery in interface SeleniumClient
See Also:
if you would like to specify your own timeout.

waitForAjaxWithJquery

public void waitForAjaxWithJquery(long timeoutMillis)
Description copied from interface: SeleniumClient
Waits for the page to finish loading ajax calls, and returns if there are no more ajax calls currently running. The method will check for a maximum of timeoutMillis

Specified by:
waitForAjaxWithJquery in interface SeleniumClient

click

public void click(String locator,
                  boolean waitForPageToLoad)
Description copied from interface: SeleniumClient
Click the element with the given locator and optionally wait for the page to load, using #PAGE_LOAD_WAIT.

Specified by:
click in interface SeleniumClient
Parameters:
locator - the element to click, specified using Selenium selector syntax
waitForPageToLoad - whether to wait for the page to reload. Don't use this unless the page is completely reloaded.
See Also:
if you would like to specify your own timeout.

submit

public void submit(String form,
                   boolean waitForPageToLoad)
Description copied from interface: SeleniumClient
Submit the named form locator and optionally wait for the page to load, using #PAGE_LOAD_WAIT.

Specified by:
submit in interface SeleniumClient
Parameters:
form - to click, specified using Selenium selector syntax
waitForPageToLoad - whether to wait for the page to reload. Don't use this unless the page is completely reloaded.
See Also:
if you would like to specify your own timeout.

click

public void click(String locator,
                  long timeoutMillis)
Description copied from interface: SeleniumClient
Click the element with the given locator and wait for the page to load, for a maximum of timeoutMillis.

Do not use this method if the page does not reload.

Specified by:
click in interface SeleniumClient
Parameters:
locator - the element to click, specified using Selenium selector syntax
timeoutMillis - the maximum number of milliseconds to wait for the page to load. Polling takes place more frequently.
See Also:
if you would like to use the default timeout

clickAndWaitForAjaxWithJquery

public void clickAndWaitForAjaxWithJquery(String locator)
Description copied from interface: SeleniumClient
Click the element with the given locator and wait for the ajax call to finish.

Specified by:
clickAndWaitForAjaxWithJquery in interface SeleniumClient
Parameters:
locator - the element to click, specified using Selenium selector syntax

clickAndWaitForAjaxWithJquery

public void clickAndWaitForAjaxWithJquery(String locator,
                                          long timeoutMillis)
Description copied from interface: SeleniumClient
Click the element with the given locator and wait for the ajax call to finish.

Specified by:
clickAndWaitForAjaxWithJquery in interface SeleniumClient
Parameters:
locator - the element to click, specified using Selenium selector syntax
timeoutMillis - the maximum number of milliseconds to wait for the ajax calls to finish.
See Also:
if you would like to use the default timeout

submit

public void submit(String form,
                   long timeoutMillis)
Description copied from interface: SeleniumClient
Submit the given form and wait for the page to load, for a maximum of timeoutMillis.

Do not use this method if the page does not reload.

Specified by:
submit in interface SeleniumClient
Parameters:
form - the form to submit
timeoutMillis - the maximum number of milliseconds to wait for the page to load. Polling takes place more frequently.
See Also:
if you would like to use the default timeout

keyPress

public void keyPress(String locator,
                     String key)
Description copied from interface: SeleniumClient
This will type into a field by sending key down / key press / key up events.

Specified by:
keyPress in interface SeleniumClient
Specified by:
keyPress in interface com.thoughtworks.selenium.Selenium
Parameters:
locator - Uses the Selenium locator syntax
key - The key to be pressed

shiftKeyDown

public void shiftKeyDown()
Specified by:
shiftKeyDown in interface com.thoughtworks.selenium.Selenium

shiftKeyUp

public void shiftKeyUp()
Specified by:
shiftKeyUp in interface com.thoughtworks.selenium.Selenium

metaKeyDown

public void metaKeyDown()
Specified by:
metaKeyDown in interface com.thoughtworks.selenium.Selenium

metaKeyUp

public void metaKeyUp()
Specified by:
metaKeyUp in interface com.thoughtworks.selenium.Selenium

altKeyDown

public void altKeyDown()
Specified by:
altKeyDown in interface com.thoughtworks.selenium.Selenium

altKeyUp

public void altKeyUp()
Specified by:
altKeyUp in interface com.thoughtworks.selenium.Selenium

controlKeyDown

public void controlKeyDown()
Specified by:
controlKeyDown in interface com.thoughtworks.selenium.Selenium

controlKeyUp

public void controlKeyUp()
Specified by:
controlKeyUp in interface com.thoughtworks.selenium.Selenium

keyDown

public void keyDown(String s,
                    String s1)
Specified by:
keyDown in interface com.thoughtworks.selenium.Selenium

keyUp

public void keyUp(String s,
                  String s1)
Specified by:
keyUp in interface com.thoughtworks.selenium.Selenium

mouseOver

public void mouseOver(String s)
Specified by:
mouseOver in interface com.thoughtworks.selenium.Selenium

mouseOut

public void mouseOut(String s)
Specified by:
mouseOut in interface com.thoughtworks.selenium.Selenium

mouseDown

public void mouseDown(String s)
Specified by:
mouseDown in interface com.thoughtworks.selenium.Selenium

mouseDownRight

public void mouseDownRight(String s)
Specified by:
mouseDownRight in interface com.thoughtworks.selenium.Selenium

mouseDownAt

public void mouseDownAt(String s,
                        String s1)
Specified by:
mouseDownAt in interface com.thoughtworks.selenium.Selenium

mouseDownRightAt

public void mouseDownRightAt(String s,
                             String s1)
Specified by:
mouseDownRightAt in interface com.thoughtworks.selenium.Selenium

mouseUp

public void mouseUp(String s)
Specified by:
mouseUp in interface com.thoughtworks.selenium.Selenium

mouseUpRight

public void mouseUpRight(String s)
Specified by:
mouseUpRight in interface com.thoughtworks.selenium.Selenium

mouseUpAt

public void mouseUpAt(String s,
                      String s1)
Specified by:
mouseUpAt in interface com.thoughtworks.selenium.Selenium

mouseUpRightAt

public void mouseUpRightAt(String s,
                           String s1)
Specified by:
mouseUpRightAt in interface com.thoughtworks.selenium.Selenium

mouseMove

public void mouseMove(String s)
Specified by:
mouseMove in interface com.thoughtworks.selenium.Selenium

mouseMoveAt

public void mouseMoveAt(String s,
                        String s1)
Specified by:
mouseMoveAt in interface com.thoughtworks.selenium.Selenium

type

public void type(String s,
                 String s1)
Specified by:
type in interface com.thoughtworks.selenium.Selenium

typeKeys

public void typeKeys(String s,
                     String s1)
Specified by:
typeKeys in interface com.thoughtworks.selenium.Selenium

setSpeed

public void setSpeed(String s)
Specified by:
setSpeed in interface com.thoughtworks.selenium.Selenium

getSpeed

public String getSpeed()
Specified by:
getSpeed in interface com.thoughtworks.selenium.Selenium

getLog

public String getLog()
Specified by:
getLog in interface com.thoughtworks.selenium.Selenium

check

public void check(String s)
Specified by:
check in interface com.thoughtworks.selenium.Selenium

uncheck

public void uncheck(String s)
Specified by:
uncheck in interface com.thoughtworks.selenium.Selenium

select

public void select(String s,
                   String s1)
Specified by:
select in interface com.thoughtworks.selenium.Selenium

addSelection

public void addSelection(String s,
                         String s1)
Specified by:
addSelection in interface com.thoughtworks.selenium.Selenium

removeSelection

public void removeSelection(String s,
                            String s1)
Specified by:
removeSelection in interface com.thoughtworks.selenium.Selenium

removeAllSelections

public void removeAllSelections(String s)
Specified by:
removeAllSelections in interface com.thoughtworks.selenium.Selenium

submit

public void submit(String s)
Specified by:
submit in interface com.thoughtworks.selenium.Selenium

open

public void open(String s,
                 String s1)
Specified by:
open in interface com.thoughtworks.selenium.Selenium

typeWithFullKeyEvents

public void typeWithFullKeyEvents(String locator,
                                  String string,
                                  boolean reset)
Description copied from interface: SeleniumClient
This will type into a field by first blanking it out and then sending key down / key press / key up events.

Specified by:
typeWithFullKeyEvents in interface SeleniumClient
Parameters:
locator - the Selenium locator
string - the string to type
reset - Should the field be reset first?

typeWithFullKeyEvents

public void typeWithFullKeyEvents(String locator,
                                  String string)
Description copied from interface: SeleniumClient
This will type into a field by first blanking it out and then sending key down / key press / key up events. This really only calls SeleniumClient.typeWithFullKeyEvents(String,String,boolean))}

Specified by:
typeWithFullKeyEvents in interface SeleniumClient
Parameters:
locator - - the usual Selenium locator
string - the string to type into a field

simulateKeyPressForCharacter

public void simulateKeyPressForCharacter(String locator,
                                         Character character,
                                         Collection<KeyEventType> eventsToFire)
Description copied from interface: SeleniumClient
This will send all the events for a particular character NOTE: This function will only handle vanilla ascii characters more exotic characters will be ignored (ie. NO events will be fired). *

Specified by:
simulateKeyPressForCharacter in interface SeleniumClient
Parameters:
locator - - the usual Selenium locator
character - - the character to send
eventsToFire - - a collection of the types of events to Fire

simulateKeyPressForCharacter

public void simulateKeyPressForCharacter(String s,
                                         Character character)
Description copied from interface: SeleniumClient
This will send all the events for a particular character NOTE: This function will only handle vanilla ascii characters more exotic characters will be ignored (ie. NO events will be fired). This will fire ALL events for the Character *

Specified by:
simulateKeyPressForCharacter in interface SeleniumClient
Parameters:
s - - the usual Selenium locator
character - - the character to send

simulateKeyPressForSpecialKey

public void simulateKeyPressForSpecialKey(String locator,
                                          int keyCode,
                                          Collection<KeyEventType> eventsToFire)
Description copied from interface: SeleniumClient
This will send all the events for a particular special key (for example F1 or the down arrow key) The keyCode matches the codes in java.awt.event.KeyEvent NOTE: the return key actually fires events with a keyCode of 13 NOT VK_ENTER *

Specified by:
simulateKeyPressForSpecialKey in interface SeleniumClient
Parameters:
locator - - the usual Selenium locator
keyCode - - the code for the special Key can use java.awt.event.KeyEvent.XXX to find these
eventsToFire - - a collection of the types of events to Fire

generateKeyEvent

public void generateKeyEvent(String locator,
                             KeyEventType eventType,
                             int keyCode,
                             int characterCode,
                             boolean shiftKey,
                             boolean altKey,
                             boolean controlKey,
                             boolean metaKey)
Description copied from interface: SeleniumClient
This is a low level function to generate one keyboard event. It would be preferable to use the simulatKeyPress... functions above.

Specified by:
generateKeyEvent in interface SeleniumClient
Parameters:
locator - - the locator of the element to send the keyevent to
eventType - - The type of key event
keyCode - - the keyCode for the keyEvent
characterCode - - the character code for the key event
shiftKey - - Is the shift key down?
altKey - - Is the alt/option key down?
controlKey - - Is the control key down?
metaKey - - Is the meta (aka the apple or windows) key down?

simulateKeyPressForSpecialKey

public void simulateKeyPressForSpecialKey(String s,
                                          int i)
Description copied from interface: SeleniumClient
This will send all the events for a particular special key (for example F1 or the down arrow key) The keyCode matches the codes in java.awt.event.KeyEvent NOTE: the return key actually fires events with a keyCode of 13 NOT VK_ENTER This will fire ALL events for the special key. *

Specified by:
simulateKeyPressForSpecialKey in interface SeleniumClient
Parameters:
s - - the usual Selenium locator
i - - the code for the special Key can use java.awt.event.KeyEvent.XXX to find these

toggleToKeyCode

public void toggleToKeyCode(boolean b)
Description copied from interface: SeleniumClient
This sets if subsiquent calls to the keyEvent (@keyDown, @keyPress, @keyUp) fuctions will set the code in the keyCode or not. This is applicable to Firefox and webkit.

Specified by:
toggleToKeyCode in interface SeleniumClient
Parameters:
b - - to set or not to set the keyCode in the event

toggleToCharacterCode

public void toggleToCharacterCode(boolean b)
Description copied from interface: SeleniumClient
This sets if subsiquent calls to the keyEvent (@keyDown, @keyPress, @keyUp) fuctions will set the code in the characterCode or not. This is applicable to Firefox and webkit.

Specified by:
toggleToCharacterCode in interface SeleniumClient
Parameters:
b - - to set or not to set the characterCode in the event

selectOption

public void selectOption(String selectName,
                         String label)
Description copied from interface: SeleniumClient
This will select an option from a select field.

Specified by:
selectOption in interface SeleniumClient
Parameters:
selectName - the select field name
label - the label to select

selectOptionAndWaitForAjaxWithJquery

public void selectOptionAndWaitForAjaxWithJquery(String selectName,
                                                 String label)
Description copied from interface: SeleniumClient
This will select an option from a select field. If the field calls executes an ajax call onchange of the value, this method will wait for that ajax method to finish.

Specified by:
selectOptionAndWaitForAjaxWithJquery in interface SeleniumClient
Parameters:
selectName - the select field name
label - the label to select

check

public void check(String name,
                  String value)
Description copied from interface: SeleniumClient
Checks a checkbox given a name and value.

Specified by:
check in interface SeleniumClient

clickLinkWithText

public void clickLinkWithText(String text,
                              boolean waitForPageToLoad)
Specified by:
clickLinkWithText in interface SeleniumClient

clickButton

public void clickButton(String buttonText,
                        boolean waitForPageToLoad)
Specified by:
clickButton in interface SeleniumClient

clickButtonAndWaitForAjaxWithJquery

public void clickButtonAndWaitForAjaxWithJquery(String buttonText)
Specified by:
clickButtonAndWaitForAjaxWithJquery in interface SeleniumClient

clickButtonWithName

public void clickButtonWithName(String buttonName,
                                boolean waitForPageToLoad)
Specified by:
clickButtonWithName in interface SeleniumClient

clickButtonWithNameAndWaitForAjaxWithJquery

public void clickButtonWithNameAndWaitForAjaxWithJquery(String buttonName)
Specified by:
clickButtonWithNameAndWaitForAjaxWithJquery in interface SeleniumClient

clickElementWithTitle

public void clickElementWithTitle(String title)
Specified by:
clickElementWithTitle in interface SeleniumClient

clickElementWithTitleAndWaitForAjaxWithJquery

public void clickElementWithTitleAndWaitForAjaxWithJquery(String title)
Specified by:
clickElementWithTitleAndWaitForAjaxWithJquery in interface SeleniumClient

clickElementWithClass

public void clickElementWithClass(String className)
Specified by:
clickElementWithClass in interface SeleniumClient

clickElementWithClassAndWaitForAjaxWithJquery

public void clickElementWithClassAndWaitForAjaxWithJquery(String className)
Specified by:
clickElementWithClassAndWaitForAjaxWithJquery in interface SeleniumClient

clickElementWithCss

public void clickElementWithCss(String cssSelector)
Specified by:
clickElementWithCss in interface SeleniumClient

clickElementWithCssAndWaitForAjaxWithJquery

public void clickElementWithCssAndWaitForAjaxWithJquery(String cssSelector)
Specified by:
clickElementWithCssAndWaitForAjaxWithJquery in interface SeleniumClient

clickElementWithXpath

public void clickElementWithXpath(String xpath)
Specified by:
clickElementWithXpath in interface SeleniumClient

clickElementWithXpathAndWaitForAjaxWithJquery

public void clickElementWithXpathAndWaitForAjaxWithJquery(String xpath)
Specified by:
clickElementWithXpathAndWaitForAjaxWithJquery in interface SeleniumClient

typeInElementWithName

public void typeInElementWithName(String elementName,
                                  String text)
Specified by:
typeInElementWithName in interface SeleniumClient

typeInElementWithCss

public void typeInElementWithCss(String cssSelector,
                                 String text)
Specified by:
typeInElementWithCss in interface SeleniumClient

hasJquery

public boolean hasJquery()
Specified by:
hasJquery in interface SeleniumClient

setExtensionJs

public void setExtensionJs(String s)
Specified by:
setExtensionJs in interface com.thoughtworks.selenium.Selenium

start

public void start()
Specified by:
start in interface SeleniumClient
Specified by:
start in interface com.thoughtworks.selenium.Selenium

start

public void start(String s)
Specified by:
start in interface com.thoughtworks.selenium.Selenium

start

public void start(Object o)
Specified by:
start in interface com.thoughtworks.selenium.Selenium

stop

public void stop()
Specified by:
stop in interface com.thoughtworks.selenium.Selenium

showContextualBanner

public void showContextualBanner()
Specified by:
showContextualBanner in interface com.thoughtworks.selenium.Selenium

showContextualBanner

public void showContextualBanner(String s,
                                 String s1)
Specified by:
showContextualBanner in interface com.thoughtworks.selenium.Selenium

click

public void click(String s)
Specified by:
click in interface com.thoughtworks.selenium.Selenium

doubleClick

public void doubleClick(String s)
Specified by:
doubleClick in interface com.thoughtworks.selenium.Selenium

contextMenu

public void contextMenu(String s)
Specified by:
contextMenu in interface com.thoughtworks.selenium.Selenium

clickAt

public void clickAt(String s,
                    String s1)
Specified by:
clickAt in interface com.thoughtworks.selenium.Selenium

doubleClickAt

public void doubleClickAt(String s,
                          String s1)
Specified by:
doubleClickAt in interface com.thoughtworks.selenium.Selenium

contextMenuAt

public void contextMenuAt(String s,
                          String s1)
Specified by:
contextMenuAt in interface com.thoughtworks.selenium.Selenium

fireEvent

public void fireEvent(String s,
                      String s1)
Specified by:
fireEvent in interface com.thoughtworks.selenium.Selenium

focus

public void focus(String s)
Specified by:
focus in interface com.thoughtworks.selenium.Selenium

getBrowser

public Browser getBrowser()
Specified by:
getBrowser in interface SeleniumClient

seleniumKeyPress

public void seleniumKeyPress(String locator,
                             String key)
Specified by:
seleniumKeyPress in interface SeleniumClient

evaluate

public void evaluate(String command)
Description copied from interface: VisualComparableClient
Execute a script in the client.

Specified by:
evaluate in interface VisualComparableClient
Parameters:
command - a string of javascript to send to the client.

execute

public Object execute(String command,
                      Object... arguments)
Description copied from interface: VisualComparableClient
Execute a script in the client and return the evaluated result.

Specified by:
execute in interface VisualComparableClient
Parameters:
command - a string of javascript to send to the client.
arguments - additional arguments to provide to the script.
Returns:
the evaluated result of the javascript.

captureEntirePageScreenshot

public void captureEntirePageScreenshot(String filePath)
Specified by:
captureEntirePageScreenshot in interface VisualComparableClient

resizeScreen

public boolean resizeScreen(ScreenResolution resolution,
                            boolean refreshAfterResize)
Specified by:
resizeScreen in interface VisualComparableClient

refreshAndWait

public void refreshAndWait()
Specified by:
refreshAndWait in interface VisualComparableClient

waitForJQuery

public boolean waitForJQuery(long waitTimeMillis)
Description copied from interface: VisualComparableClient
Wait until all active jQuery AJAX queries have returned -- i.e., no AJAX queries are active.

Specified by:
waitForJQuery in interface VisualComparableClient
Parameters:
waitTimeMillis - the time to wait for everything to finish.
Returns:
true if no AJAX query is active, false otherwise.

getElementAtPoint

public ScreenElement getElementAtPoint(int x,
                                       int y)
Specified by:
getElementAtPoint in interface VisualComparableClient


Copyright © 2014 Atlassian. All rights reserved.