com.atlassian.selenium
Interface SeleniumClient

All Superinterfaces:
com.thoughtworks.selenium.Selenium
All Known Implementing Classes:
SingleBrowserSeleniumClient

public interface SeleniumClient
extends com.thoughtworks.selenium.Selenium

Extends the Selenium client to provide a more sensible implementation as well some extra utility methods such as keypress.


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 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 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)
           
 Browser getBrowser()
           
 boolean hasJquery()
           
 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, 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)
          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 seleniumKeyPress(String locator, String key)
           
 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 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 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.
 
Methods inherited from interface com.thoughtworks.selenium.Selenium
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
 

Method Detail

open

void open(String url)
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 com.thoughtworks.selenium.Selenium

openNoWait

void openNoWait(String url)
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.

Parameters:
url -

open

void open(String url,
          long timeoutMillis)
Opens the given URL and waits a maximum of timeoutMillis for the page to load completely.


waitForPageToLoad

void waitForPageToLoad(long timeoutMillis)
Overloads Selenium.waitForPageToLoad(String) to take in a long.


waitForPageToLoad

void waitForPageToLoad()
Waits for the page to load with the default timeout configured in SeleniumConfiguration.


waitForCondition

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.

See Also:
if you would like to specify your own timeout.

waitForCondition

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.


waitForAjaxWithJquery

void waitForAjaxWithJquery()
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

See Also:
if you would like to specify your own timeout.

waitForAjaxWithJquery

void waitForAjaxWithJquery(long timeoutMillis)
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


click

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.

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

void submit(String form,
            boolean waitForPageToLoad)
Submit the named form locator and optionally wait for the page to load, using #PAGE_LOAD_WAIT.

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

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.

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

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

void clickAndWaitForAjaxWithJquery(String locator)
Click the element with the given locator and wait for the ajax call to finish.

Parameters:
locator - the element to click, specified using Selenium selector syntax

clickAndWaitForAjaxWithJquery

void clickAndWaitForAjaxWithJquery(String locator,
                                   long timeoutMillis)
Click the element with the given locator and wait for the ajax call to finish.

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

void submit(String form,
            long timeoutMillis)
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.

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

void keyPress(String locator,
              String key)
This will type into a field by sending key down / key press / key up events.

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

typeWithFullKeyEvents

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.

Parameters:
locator - the Selenium locator
string - the string to type
reset - Should the field be reset first?

typeWithFullKeyEvents

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. This really only calls typeWithFullKeyEvents(String,String,boolean))}

Parameters:
locator - - the usual Selenium locator
string - the string to type into a field

selectOption

void selectOption(String selectName,
                  String label)
This will select an option from a select field.

Parameters:
selectName - the select field name
label - the label to select

selectOptionAndWaitForAjaxWithJquery

void selectOptionAndWaitForAjaxWithJquery(String selectName,
                                          String label)
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.

Parameters:
selectName - the select field name
label - the label to select

check

void check(String name,
           String value)
Checks a checkbox given a name and value.


clickLinkWithText

void clickLinkWithText(String text,
                       boolean waitForPageToLoad)

clickButton

void clickButton(String buttonText,
                 boolean waitForPageToLoad)

clickButtonAndWaitForAjaxWithJquery

void clickButtonAndWaitForAjaxWithJquery(String buttonText)

clickButtonWithName

void clickButtonWithName(String buttonName,
                         boolean waitForPageToLoad)

clickButtonWithNameAndWaitForAjaxWithJquery

void clickButtonWithNameAndWaitForAjaxWithJquery(String buttonName)

clickElementWithTitle

void clickElementWithTitle(String title)

clickElementWithTitleAndWaitForAjaxWithJquery

void clickElementWithTitleAndWaitForAjaxWithJquery(String title)

clickElementWithClass

void clickElementWithClass(String className)

clickElementWithClassAndWaitForAjaxWithJquery

void clickElementWithClassAndWaitForAjaxWithJquery(String className)

clickElementWithCss

void clickElementWithCss(String cssSelector)

clickElementWithCssAndWaitForAjaxWithJquery

void clickElementWithCssAndWaitForAjaxWithJquery(String cssSelector)

clickElementWithXpath

void clickElementWithXpath(String xpath)

clickElementWithXpathAndWaitForAjaxWithJquery

void clickElementWithXpathAndWaitForAjaxWithJquery(String xpath)

typeInElementWithName

void typeInElementWithName(String elementName,
                           String text)

typeInElementWithCss

void typeInElementWithCss(String cssSelector,
                          String text)

hasJquery

boolean hasJquery()

start

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

getBrowser

Browser getBrowser()

seleniumKeyPress

void seleniumKeyPress(String locator,
                      String key)


Copyright © 2010 Atlassian Pty Ltd. All Rights Reserved.