org.zkoss.ztl
Class ZKTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.zkoss.ztl.ZKSeleneseTestCase
              extended by org.zkoss.ztl.ZKTestCase
All Implemented Interfaces:
com.thoughtworks.selenium.Selenium, junit.framework.Test
Direct Known Subclasses:
ZKClientTestCase

public class ZKTestCase
extends ZKSeleneseTestCase
implements com.thoughtworks.selenium.Selenium

A skeleton of ZK Selenium test, which implements all of the methods of Selenium interface.

Author:
sam, jumperchen

Field Summary
protected static java.lang.ThreadLocal<com.thoughtworks.selenium.Selenium> _selenium
           
static java.lang.String A
          The keycode of the A key
static java.lang.String ALT
          The keycode of the ALT key
static java.lang.String BACKSPACE
          The keycode of the BACKSPACE key
protected  java.util.List<com.thoughtworks.selenium.Selenium> browsers
           
static java.lang.String C
          The keycode of the C key
protected  java.lang.String caseID
           
static java.lang.String CTRL
          The keycode of the CTRL key
static java.lang.String DELETE
          The keycode of the DELETE key
static java.lang.String DELETE_NATIVE
          keypressNative native follow java.awt.Event's keycode .
static java.lang.String DOWN
          The keycode of the DOWN key
static java.lang.String END
          The keycode of the END key
static java.lang.String ENTER
          The keycode of the ENTER key
static java.lang.String ESC
          The keycode of the ESC key
static java.lang.String HOME
          The keycode of the HOME key
static java.lang.String INSERT
          The keycode of the INSERT key
static java.lang.String LEFT
          The keycode of the LEFT key
static java.lang.String NUM_0
          The keycode of the Num_0
static java.lang.String NUM_1
          The keycode of the Num_1
static java.lang.String NUM_2
          The keycode of the Num_2
static java.lang.String NUM_3
          The keycode of the Num_3
static java.lang.String NUM_4
          The keycode of the Num_4
static java.lang.String NUM_5
          The keycode of the Num_5
static java.lang.String NUM_6
          The keycode of the Num_6
static java.lang.String NUM_7
          The keycode of the Num_7
static java.lang.String NUM_8
          The keycode of the Num_8
static java.lang.String NUM_9
          The keycode of the Num_9
static java.lang.String PAGE_DOWN
          The keycode of the PAGE_DOWN key
static java.lang.String PAGE_UP
          The keycode of the PAGE_UP key
protected  java.lang.ThreadLocal<java.lang.Integer> recordCount
           
static java.lang.String RIGHT
          The keycode of the RIGHT key
static java.lang.String SHIFT
          The keycode of the SHIFT key
static java.lang.String TAB
          The keycode of the TAB key
protected  java.lang.String target
           
static java.lang.String UP
          The keycode of the UP key
static java.lang.String V
          The keycode of the V key
static java.lang.String X
          The keycode of the X key
 
Fields inherited from class org.zkoss.ztl.ZKSeleneseTestCase
selenium, timeUUID
 
Constructor Summary
ZKTestCase()
           
 
Method Summary
 void addCustomRequestHeader(java.lang.String arg0, java.lang.String arg1)
           
 void addLocationStrategy(java.lang.String strategyName, java.lang.String functionDefinition)
          untested yet protected List getLoggingBrowsers(String browsers, BufferedWriter loggingWriter){ return ConfigHelper.getInstance().getLoggingBrowsers(browsers, loggingWriter); }
 void addScript(java.lang.String scriptContent, java.lang.String scriptTagId)
           
 void addSelection(java.lang.String locator, java.lang.String optionLocator)
           
 void allowNativeXpath(java.lang.String allow)
           
 void altKeyDown()
           
 void altKeyUp()
           
 void answerOnNextPrompt(java.lang.String answer)
           
 void assignId(java.lang.String locator, java.lang.String identifier)
           
 void attachFile(java.lang.String fieldLocator, java.lang.String fileLocator)
           
 void captureEntirePageScreenshot(java.lang.String filename, java.lang.String kwargs)
           
 java.lang.String captureEntirePageScreenshotToString(java.lang.String kwargs)
           
 java.lang.String captureNetworkTraffic(java.lang.String arg0)
           
 void captureScreenshot(java.lang.String filename)
           
 java.lang.String captureScreenshotToString()
           
 void check(java.lang.String locator)
           
 void chooseCancelOnNextConfirmation()
           
 void chooseOkOnNextConfirmation()
           
 void click(java.lang.String locator)
           
 void clickAt(java.lang.String locator, java.lang.String coordString)
           
 void close()
           
 void contextMenu(java.lang.String locator)
           
 void contextMenuAt(java.lang.String locator, java.lang.String coordString)
           
 void controlKeyDown()
           
 void controlKeyUp()
           
 void createCookie(java.lang.String nameValuePair, java.lang.String optionsString)
           
 void deleteAllVisibleCookies()
           
 void deleteCookie(java.lang.String name, java.lang.String optionsString)
           
 void deselectPopUp()
           
 void doubleClick(java.lang.String locator)
           
 void doubleClickAt(java.lang.String locator, java.lang.String coordString)
           
 void dragAndDrop(java.lang.String locator, java.lang.String movementsString)
           
 void dragAndDropToObject(java.lang.String locatorOfObjectToBeDragged, java.lang.String locatorOfDragDestinationObject)
           
 void dragdrop(java.lang.String locator, java.lang.String movementsString)
           
 void dragdropTo(java.lang.String locatorOfObjectToBeDragged, java.lang.String from, java.lang.String to)
          Drags and drops the specific element from its specific area to another area.
 void dragdropToObject(java.lang.String locatorOfObjectToBeDragged, java.lang.String locatorOfDragDestinationObject, java.lang.String from, java.lang.String to)
          Drags and drops the specific element from its specific area to another element.
 java.lang.Object executeScript(java.lang.String s, java.lang.Object... args)
          Executes the javascript by the current web driver.
 org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
          Find the first WebElement using the given method.
 void fireEvent(java.lang.String locator, java.lang.String eventName)
           
 void focus(java.lang.String locator)
           
 org.openqa.selenium.interactions.Actions getActions()
          Returns the browser actions for Selenium 2.x
 java.lang.String getAlert()
           
 java.lang.String[] getAllButtons()
           
 java.lang.String[] getAllFields()
           
 java.lang.String[] getAllLinks()
           
 java.lang.String[] getAllWindowIds()
           
 java.lang.String[] getAllWindowNames()
           
 java.lang.String[] getAllWindowTitles()
           
 java.lang.String getAttribute(java.lang.String attributeLocator)
           
 java.lang.String[] getAttributeFromAllWindows(java.lang.String attributeName)
           
 java.lang.String getBodyText()
           
protected  java.util.List<com.thoughtworks.selenium.Selenium> getBrowsers(java.lang.String browsers)
           
 java.lang.String getConfirmation()
           
 java.lang.String getCookie()
           
 java.lang.String getCookieByName(java.lang.String name)
           
 java.lang.Number getCssCount(java.lang.String arg0)
           
static com.thoughtworks.selenium.Selenium getCurrent()
          Returns the current browser.
 java.lang.Number getCursorPosition(java.lang.String locator)
           
 java.lang.Number getElementHeight(java.lang.String locator)
           
 java.lang.Number getElementIndex(java.lang.String locator)
           
 java.lang.Number getElementPositionLeft(java.lang.String locator)
           
 java.lang.Number getElementPositionTop(java.lang.String locator)
           
 java.lang.Number getElementWidth(java.lang.String locator)
           
 java.lang.String getEval(java.lang.String script)
           
 java.lang.String getExpression(java.lang.String expression)
           
 java.lang.String getHtmlSource()
           
 org.openqa.selenium.interactions.Keyboard getKeyboard()
          Returns the browser keyboard for Selenium 2.x
 java.lang.String getLocation()
           
 java.lang.String getLog()
           
 org.openqa.selenium.interactions.Mouse getMouse()
          Returns the browser mouse for Selenium 2.x
 java.lang.Number getMouseSpeed()
           
 java.lang.String getPrompt()
           
 java.lang.String getSelectedId(java.lang.String selectLocator)
           
 java.lang.String[] getSelectedIds(java.lang.String selectLocator)
           
 java.lang.String getSelectedIndex(java.lang.String selectLocator)
           
 java.lang.String[] getSelectedIndexes(java.lang.String selectLocator)
           
 java.lang.String getSelectedLabel(java.lang.String selectLocator)
           
 java.lang.String[] getSelectedLabels(java.lang.String selectLocator)
           
 java.lang.String getSelectedValue(java.lang.String selectLocator)
           
 java.lang.String[] getSelectedValues(java.lang.String selectLocator)
           
 java.lang.String[] getSelectOptions(java.lang.String selectLocator)
           
 java.lang.String getSpeed()
           
 java.lang.String getTable(java.lang.String tableCellAddress)
           
 java.lang.String getText(java.lang.String locator)
           
 java.lang.String getTitle()
           
 org.openqa.selenium.interactions.TouchScreen getTouch()
          Returns the touch screen for Selenium 2.x
 java.lang.String getValue(java.lang.String locator)
           
 org.openqa.selenium.WebDriver getWebDriver()
          Returns the web driver.
 boolean getWhetherThisFrameMatchFrameExpression(java.lang.String currentFrameString, java.lang.String target)
           
 boolean getWhetherThisWindowMatchWindowExpression(java.lang.String currentWindowString, java.lang.String target)
           
 java.lang.Number getXpathCount(java.lang.String xpath)
           
 void goBack()
           
 void highlight(java.lang.String locator)
           
 void ignoreAttributesWithoutValue(java.lang.String ignore)
           
 boolean isAlertPresent()
           
 boolean isAndroid()
          Returns whether is Android Driver
 boolean isChecked(java.lang.String locator)
           
 boolean isChrome()
          Returns whether is Chrome Driver
 boolean isConfirmationPresent()
           
 boolean isCookiePresent(java.lang.String name)
           
 boolean isEditable(java.lang.String locator)
           
 boolean isElementPresent(java.lang.String locator)
           
 boolean isFirefox()
          Returns whether is Firefox Driver
 boolean isHtmlUnit()
          Returns whether is HTML Unit Driver
 boolean isIE()
          Returns whether is InternatExplorer Driver
 boolean isIPhone()
          Returns whether is IPhone Driver
 boolean isOpera()
          Returns whether is Opera Driver
 boolean isOrdered(java.lang.String locator1, java.lang.String locator2)
           
 boolean isPromptPresent()
           
 boolean isSafari()
          Returns whether is Chrome Driver
 boolean isSomethingSelected(java.lang.String selectLocator)
           
 boolean isTextPresent(java.lang.String pattern)
           
 boolean isVisible(java.lang.String locator)
           
 void keyDown(java.lang.String locator, java.lang.String keySequence)
           
 void keyDownNative(java.lang.String keycode)
           
 void keyPress(java.lang.String locator, java.lang.String keySequence)
           
 void keyPressNative(java.lang.String keycode)
           
 void keyUp(java.lang.String locator, java.lang.String keySequence)
           
 void keyUpNative(java.lang.String keycode)
           
 void metaKeyDown()
           
 void metaKeyUp()
           
 void mouseDown(java.lang.String locator)
           
 void mouseDownAt(java.lang.String locator, java.lang.String coordString)
           
 void mouseDownRight(java.lang.String locator)
           
 void mouseDownRightAt(java.lang.String locator, java.lang.String coordString)
           
 void mouseMove(java.lang.String locator)
           
 void mouseMoveAt(java.lang.String locator, java.lang.String coordString)
           
 void mouseOut(java.lang.String locator)
           
 void mouseOver(java.lang.String locator)
           
 void mouseUp(java.lang.String locator)
           
 void mouseUpAt(java.lang.String locator, java.lang.String coordString)
           
 void mouseUpRight(java.lang.String locator)
           
 void mouseUpRightAt(java.lang.String locator, java.lang.String coordString)
           
 void open(java.lang.String url)
           
 void open(java.lang.String arg0, java.lang.String arg1)
           
 void openWindow(java.lang.String url, java.lang.String windowID)
           
 void refresh()
           
 void removeAllSelections(java.lang.String locator)
           
 void removeScript(java.lang.String scriptTagId)
           
 void removeSelection(java.lang.String locator, java.lang.String optionLocator)
           
 java.lang.String retrieveLastRemoteControlLogs()
           
 void rollup(java.lang.String rollupName, java.lang.String kwargs)
           
 void runScript(java.lang.String script)
           
 void select(java.lang.String selectLocator, java.lang.String optionLocator)
           
 void selectFrame(java.lang.String locator)
           
 void selectPopUp(java.lang.String arg0)
           
 void selectWindow(java.lang.String windowID)
           
 void setBrowserLogLevel(java.lang.String logLevel)
           
 void setContext(java.lang.String context)
           
 void setCursorPosition(java.lang.String locator, java.lang.String position)
           
 void setExtensionJs(java.lang.String extensionJs)
           
 void setMouseSpeed(java.lang.String pixels)
           
 void setSpeed(java.lang.String value)
           
 void setTimeout(java.lang.String timeout)
           
 void setUp()
          Calls this.setUp(null)
 void shiftKeyDown()
           
 void shiftKeyUp()
           
 void showContextualBanner()
           
 void showContextualBanner(java.lang.String className, java.lang.String methodName)
           
 void shutDownSeleniumServer()
           
protected  void sleep(long millis)
          Causes the currently executing thread to sleep for the specified number of milliseconds, subject to the precision and accuracy of system timers and schedulers.
 void start()
           
 void start(java.lang.Object optionsObject)
           
protected  void start(com.thoughtworks.selenium.Selenium selenium)
          Launches the browser with a new Selenium session
 void start(java.lang.String optionsString)
           
 void stop()
           
 void submit(java.lang.String formLocator)
           
 void type(java.lang.String locator, java.lang.String value)
           
 void typeKeys(java.lang.String locator, java.lang.String value)
           
 void uncheck(java.lang.String locator)
           
 void useXpathLibrary(java.lang.String libraryName)
           
protected static java.lang.String uuid(int number)
           
 void verifyContains(java.lang.String word1, java.lang.String contains)
           
 void verifyEquals(java.lang.Object obj1, java.lang.Object obj2)
          Like assertEquals, but fails at the end of the test (during tearDown)
 void verifyImage()
          Compares the snapshot of the testing result.
 void verifyImage(Comparator comparator)
           
 void verifyNotContains(java.lang.String word1, java.lang.String contains)
           
 void waitForCondition(java.lang.String script, java.lang.String timeout)
           
 void waitForFrameToLoad(java.lang.String frameAddress, java.lang.String timeout)
           
 void waitForPageToLoad(java.lang.String timeout)
           
 void waitForPopUp(java.lang.String windowID, java.lang.String timeout)
           
 void windowFocus()
           
 void windowMaximize()
           
 void windowResizeTo(int width, int height)
          Resizes the current window to the size(width and height).
 
Methods inherited from class org.zkoss.ztl.ZKSeleneseTestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertNotEquals, assertNotEquals, checkForVerificationErrors, clearVerificationErrors, getText, getTimeUUID, isCaptureScreenShotOnFailure, isCaptureScreetShotOnFailure, join, pause, runBare, runtimeBrowserString, seleniumEquals, seleniumEquals, setCaptureScreenShotOnFailure, setCaptureScreetShotOnFailure, setTestContext, setUp, setUp, tearDown, verifyContains, verifyEquals, verifyEquals, verifyEquals, verifyEquals, verifyEquals, verifyFalse, verifyFalse, verifyNotContains, verifyNotEquals, verifyNotEquals, verifyNotEquals, verifyNotEquals, verifyTolerant, verifyTrue, verifyTrue
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_selenium

protected static final java.lang.ThreadLocal<com.thoughtworks.selenium.Selenium> _selenium

PAGE_UP

public static final java.lang.String PAGE_UP
The keycode of the PAGE_UP key

See Also:
Constant Field Values

PAGE_DOWN

public static final java.lang.String PAGE_DOWN
The keycode of the PAGE_DOWN key

See Also:
Constant Field Values

END

public static final java.lang.String END
The keycode of the END key

See Also:
Constant Field Values

HOME

public static final java.lang.String HOME
The keycode of the HOME key

See Also:
Constant Field Values

LEFT

public static final java.lang.String LEFT
The keycode of the LEFT key

See Also:
Constant Field Values

UP

public static final java.lang.String UP
The keycode of the UP key

See Also:
Constant Field Values

RIGHT

public static final java.lang.String RIGHT
The keycode of the RIGHT key

See Also:
Constant Field Values

DOWN

public static final java.lang.String DOWN
The keycode of the DOWN key

See Also:
Constant Field Values

INSERT

public static final java.lang.String INSERT
The keycode of the INSERT key

See Also:
Constant Field Values

DELETE

public static final java.lang.String DELETE
The keycode of the DELETE key

See Also:
Constant Field Values

DELETE_NATIVE

public static final java.lang.String DELETE_NATIVE
keypressNative native follow java.awt.Event's keycode .

See Also:
Constant Field Values

BACKSPACE

public static final java.lang.String BACKSPACE
The keycode of the BACKSPACE key

See Also:
Constant Field Values

TAB

public static final java.lang.String TAB
The keycode of the TAB key

See Also:
Constant Field Values

ENTER

public static final java.lang.String ENTER
The keycode of the ENTER key

See Also:
Constant Field Values

ESC

public static final java.lang.String ESC
The keycode of the ESC key

See Also:
Constant Field Values

SHIFT

public static final java.lang.String SHIFT
The keycode of the SHIFT key

See Also:
Constant Field Values

CTRL

public static final java.lang.String CTRL
The keycode of the CTRL key

See Also:
Constant Field Values

ALT

public static final java.lang.String ALT
The keycode of the ALT key

See Also:
Constant Field Values

NUM_0

public static final java.lang.String NUM_0
The keycode of the Num_0

See Also:
Constant Field Values

NUM_1

public static final java.lang.String NUM_1
The keycode of the Num_1

See Also:
Constant Field Values

NUM_2

public static final java.lang.String NUM_2
The keycode of the Num_2

See Also:
Constant Field Values

NUM_3

public static final java.lang.String NUM_3
The keycode of the Num_3

See Also:
Constant Field Values

NUM_4

public static final java.lang.String NUM_4
The keycode of the Num_4

See Also:
Constant Field Values

NUM_5

public static final java.lang.String NUM_5
The keycode of the Num_5

See Also:
Constant Field Values

NUM_6

public static final java.lang.String NUM_6
The keycode of the Num_6

See Also:
Constant Field Values

NUM_7

public static final java.lang.String NUM_7
The keycode of the Num_7

See Also:
Constant Field Values

NUM_8

public static final java.lang.String NUM_8
The keycode of the Num_8

See Also:
Constant Field Values

NUM_9

public static final java.lang.String NUM_9
The keycode of the Num_9

See Also:
Constant Field Values

A

public static final java.lang.String A
The keycode of the A key

See Also:
Constant Field Values

C

public static final java.lang.String C
The keycode of the C key

See Also:
Constant Field Values

V

public static final java.lang.String V
The keycode of the V key

See Also:
Constant Field Values

X

public static final java.lang.String X
The keycode of the X key

See Also:
Constant Field Values

target

protected java.lang.String target

browsers

protected java.util.List<com.thoughtworks.selenium.Selenium> browsers

caseID

protected java.lang.String caseID

recordCount

protected java.lang.ThreadLocal<java.lang.Integer> recordCount
Constructor Detail

ZKTestCase

public ZKTestCase()
Method Detail

start

protected void start(com.thoughtworks.selenium.Selenium selenium)
Launches the browser with a new Selenium session


getCurrent

public static final com.thoughtworks.selenium.Selenium getCurrent()
Returns the current browser.


getWebDriver

public org.openqa.selenium.WebDriver getWebDriver()
Returns the web driver.

Since:
2.0.0

getMouse

public org.openqa.selenium.interactions.Mouse getMouse()
Returns the browser mouse for Selenium 2.x

Since:
2.0.0

getKeyboard

public org.openqa.selenium.interactions.Keyboard getKeyboard()
Returns the browser keyboard for Selenium 2.x

Since:
2.0.0

getTouch

public org.openqa.selenium.interactions.TouchScreen getTouch()
Returns the touch screen for Selenium 2.x

Since:
2.0.1

getActions

public org.openqa.selenium.interactions.Actions getActions()
Returns the browser actions for Selenium 2.x

Since:
2.0.0

isHtmlUnit

public boolean isHtmlUnit()
Returns whether is HTML Unit Driver

Since:
2.0.0

isIE

public boolean isIE()
Returns whether is InternatExplorer Driver

Since:
2.0.0

isFirefox

public boolean isFirefox()
Returns whether is Firefox Driver

Since:
2.0.0

isChrome

public boolean isChrome()
Returns whether is Chrome Driver

Since:
2.0.0

isSafari

public boolean isSafari()
Returns whether is Chrome Driver

Since:
2.0.0

isOpera

public boolean isOpera()
Returns whether is Opera Driver

Since:
2.0.0

isIPhone

public boolean isIPhone()
Returns whether is IPhone Driver

Since:
2.0.0

isAndroid

public boolean isAndroid()
Returns whether is Android Driver

Since:
2.0.0

findElement

public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
Find the first WebElement using the given method.

Parameters:
by - The locating mechanism
Returns:
The first matching element on the current page
Throws:
org.openqa.selenium.NoSuchElementException - If no matching elements are found

executeScript

public java.lang.Object executeScript(java.lang.String s,
                                      java.lang.Object... args)
Executes the javascript by the current web driver.

Since:
2.0.0

setUp

public void setUp()
Description copied from class: ZKSeleneseTestCase
Calls this.setUp(null)

Overrides:
setUp in class ZKSeleneseTestCase
See Also:
ZKSeleneseTestCase.setUp(String)

uuid

protected static final java.lang.String uuid(int number)

getBrowsers

protected java.util.List<com.thoughtworks.selenium.Selenium> getBrowsers(java.lang.String browsers)

windowResizeTo

public void windowResizeTo(int width,
                           int height)
Resizes the current window to the size(width and height).


addLocationStrategy

public void addLocationStrategy(java.lang.String strategyName,
                                java.lang.String functionDefinition)
untested yet protected List getLoggingBrowsers(String browsers, BufferedWriter loggingWriter){ return ConfigHelper.getInstance().getLoggingBrowsers(browsers, loggingWriter); }

Specified by:
addLocationStrategy in interface com.thoughtworks.selenium.Selenium

addScript

public void addScript(java.lang.String scriptContent,
                      java.lang.String scriptTagId)
Specified by:
addScript in interface com.thoughtworks.selenium.Selenium

addSelection

public void addSelection(java.lang.String locator,
                         java.lang.String optionLocator)
Specified by:
addSelection in interface com.thoughtworks.selenium.Selenium

allowNativeXpath

public void allowNativeXpath(java.lang.String allow)
Specified by:
allowNativeXpath 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

answerOnNextPrompt

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

assignId

public void assignId(java.lang.String locator,
                     java.lang.String identifier)
Specified by:
assignId in interface com.thoughtworks.selenium.Selenium

attachFile

public void attachFile(java.lang.String fieldLocator,
                       java.lang.String fileLocator)
Specified by:
attachFile in interface com.thoughtworks.selenium.Selenium

captureEntirePageScreenshot

public void captureEntirePageScreenshot(java.lang.String filename,
                                        java.lang.String kwargs)
Specified by:
captureEntirePageScreenshot in interface com.thoughtworks.selenium.Selenium

captureEntirePageScreenshotToString

public java.lang.String captureEntirePageScreenshotToString(java.lang.String kwargs)
Specified by:
captureEntirePageScreenshotToString in interface com.thoughtworks.selenium.Selenium

captureScreenshot

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

captureScreenshotToString

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

check

public void check(java.lang.String locator)
Specified by:
check 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

click

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

clickAt

public void clickAt(java.lang.String locator,
                    java.lang.String coordString)
Specified by:
clickAt in interface com.thoughtworks.selenium.Selenium

close

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

contextMenu

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

contextMenuAt

public void contextMenuAt(java.lang.String locator,
                          java.lang.String coordString)
Specified by:
contextMenuAt 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

createCookie

public void createCookie(java.lang.String nameValuePair,
                         java.lang.String optionsString)
Specified by:
createCookie in interface com.thoughtworks.selenium.Selenium

deleteAllVisibleCookies

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

deleteCookie

public void deleteCookie(java.lang.String name,
                         java.lang.String optionsString)
Specified by:
deleteCookie in interface com.thoughtworks.selenium.Selenium

doubleClick

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

doubleClickAt

public void doubleClickAt(java.lang.String locator,
                          java.lang.String coordString)
Specified by:
doubleClickAt in interface com.thoughtworks.selenium.Selenium

dragAndDrop

public void dragAndDrop(java.lang.String locator,
                        java.lang.String movementsString)
Specified by:
dragAndDrop in interface com.thoughtworks.selenium.Selenium

dragdropTo

public void dragdropTo(java.lang.String locatorOfObjectToBeDragged,
                       java.lang.String from,
                       java.lang.String to)
Drags and drops the specific element from its specific area to another area.

For example,
draggdropTo("z-xxx", "10,20", "20,20")

The result of the "z-xxx" is moved 10px right.

Parameters:
locatorOfObjectToBeDragged - the draggable UUID
from - the "x,y" value is related to the draggable element, which is dragged from.
to - the "x,y" value is related to the draggable element, which is dropped to.

dragdropToObject

public void dragdropToObject(java.lang.String locatorOfObjectToBeDragged,
                             java.lang.String locatorOfDragDestinationObject,
                             java.lang.String from,
                             java.lang.String to)
Drags and drops the specific element from its specific area to another element.

For example,
draggdropToObject("z-xxx", "z-yyy", "10,20", "10,20")

The result of the "z-xxx" is moved to the position(10,20) of the "z-yyy".

Parameters:
locatorOfObjectToBeDragged - the draggable UUID
locatorOfDragDestinationObject - the droppable UUID
from - the "x,y" value is related to the draggable element, which is dragged from.
to - the "x,y" value is related to the droppable element, which is dropped to.

dragAndDropToObject

public void dragAndDropToObject(java.lang.String locatorOfObjectToBeDragged,
                                java.lang.String locatorOfDragDestinationObject)
Specified by:
dragAndDropToObject in interface com.thoughtworks.selenium.Selenium

dragdrop

public void dragdrop(java.lang.String locator,
                     java.lang.String movementsString)
Specified by:
dragdrop in interface com.thoughtworks.selenium.Selenium

fireEvent

public void fireEvent(java.lang.String locator,
                      java.lang.String eventName)
Specified by:
fireEvent in interface com.thoughtworks.selenium.Selenium

focus

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

getAlert

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

getAllButtons

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

getAllFields

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

getAllLinks

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

getAllWindowIds

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

getAllWindowNames

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

getAllWindowTitles

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

getAttribute

public java.lang.String getAttribute(java.lang.String attributeLocator)
Specified by:
getAttribute in interface com.thoughtworks.selenium.Selenium

getAttributeFromAllWindows

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

getBodyText

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

getConfirmation

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

getCookie

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

getCookieByName

public java.lang.String getCookieByName(java.lang.String name)
Specified by:
getCookieByName in interface com.thoughtworks.selenium.Selenium

getCursorPosition

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

getElementHeight

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

getElementIndex

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

getElementPositionLeft

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

getElementPositionTop

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

getElementWidth

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

getEval

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

getExpression

public java.lang.String getExpression(java.lang.String expression)
Specified by:
getExpression in interface com.thoughtworks.selenium.Selenium

getHtmlSource

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

getLocation

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

getMouseSpeed

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

getPrompt

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

getSelectOptions

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

getSelectedId

public java.lang.String getSelectedId(java.lang.String selectLocator)
Specified by:
getSelectedId in interface com.thoughtworks.selenium.Selenium

getSelectedIds

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

getSelectedIndex

public java.lang.String getSelectedIndex(java.lang.String selectLocator)
Specified by:
getSelectedIndex in interface com.thoughtworks.selenium.Selenium

getSelectedIndexes

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

getSelectedLabel

public java.lang.String getSelectedLabel(java.lang.String selectLocator)
Specified by:
getSelectedLabel in interface com.thoughtworks.selenium.Selenium

getSelectedLabels

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

getSelectedValue

public java.lang.String getSelectedValue(java.lang.String selectLocator)
Specified by:
getSelectedValue in interface com.thoughtworks.selenium.Selenium

getSelectedValues

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

getSpeed

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

getTable

public java.lang.String getTable(java.lang.String tableCellAddress)
Specified by:
getTable in interface com.thoughtworks.selenium.Selenium

getText

public java.lang.String getText(java.lang.String locator)
Specified by:
getText in interface com.thoughtworks.selenium.Selenium

getTitle

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

getValue

public java.lang.String getValue(java.lang.String locator)
Specified by:
getValue in interface com.thoughtworks.selenium.Selenium

getWhetherThisFrameMatchFrameExpression

public boolean getWhetherThisFrameMatchFrameExpression(java.lang.String currentFrameString,
                                                       java.lang.String target)
Specified by:
getWhetherThisFrameMatchFrameExpression in interface com.thoughtworks.selenium.Selenium

getWhetherThisWindowMatchWindowExpression

public boolean getWhetherThisWindowMatchWindowExpression(java.lang.String currentWindowString,
                                                         java.lang.String target)
Specified by:
getWhetherThisWindowMatchWindowExpression in interface com.thoughtworks.selenium.Selenium

getXpathCount

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

goBack

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

highlight

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

ignoreAttributesWithoutValue

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

isAlertPresent

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

isChecked

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

isConfirmationPresent

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

isCookiePresent

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

isEditable

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

isElementPresent

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

isOrdered

public boolean isOrdered(java.lang.String locator1,
                         java.lang.String locator2)
Specified by:
isOrdered in interface com.thoughtworks.selenium.Selenium

isPromptPresent

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

isSomethingSelected

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

isTextPresent

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

isVisible

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

keyDown

public void keyDown(java.lang.String locator,
                    java.lang.String keySequence)
Specified by:
keyDown in interface com.thoughtworks.selenium.Selenium

keyDownNative

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

keyPress

public void keyPress(java.lang.String locator,
                     java.lang.String keySequence)
Specified by:
keyPress in interface com.thoughtworks.selenium.Selenium

keyPressNative

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

keyUp

public void keyUp(java.lang.String locator,
                  java.lang.String keySequence)
Specified by:
keyUp in interface com.thoughtworks.selenium.Selenium

keyUpNative

public void keyUpNative(java.lang.String keycode)
Specified by:
keyUpNative 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

mouseDown

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

mouseDownAt

public void mouseDownAt(java.lang.String locator,
                        java.lang.String coordString)
Specified by:
mouseDownAt in interface com.thoughtworks.selenium.Selenium

mouseDownRight

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

mouseDownRightAt

public void mouseDownRightAt(java.lang.String locator,
                             java.lang.String coordString)
Specified by:
mouseDownRightAt in interface com.thoughtworks.selenium.Selenium

mouseMove

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

mouseMoveAt

public void mouseMoveAt(java.lang.String locator,
                        java.lang.String coordString)
Specified by:
mouseMoveAt in interface com.thoughtworks.selenium.Selenium

mouseOut

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

mouseOver

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

mouseUp

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

mouseUpAt

public void mouseUpAt(java.lang.String locator,
                      java.lang.String coordString)
Specified by:
mouseUpAt in interface com.thoughtworks.selenium.Selenium

mouseUpRight

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

mouseUpRightAt

public void mouseUpRightAt(java.lang.String locator,
                           java.lang.String coordString)
Specified by:
mouseUpRightAt in interface com.thoughtworks.selenium.Selenium

open

public void open(java.lang.String url)
Specified by:
open in interface com.thoughtworks.selenium.Selenium

openWindow

public void openWindow(java.lang.String url,
                       java.lang.String windowID)
Specified by:
openWindow in interface com.thoughtworks.selenium.Selenium

refresh

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

removeAllSelections

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

removeScript

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

removeSelection

public void removeSelection(java.lang.String locator,
                            java.lang.String optionLocator)
Specified by:
removeSelection in interface com.thoughtworks.selenium.Selenium

retrieveLastRemoteControlLogs

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

rollup

public void rollup(java.lang.String rollupName,
                   java.lang.String kwargs)
Specified by:
rollup in interface com.thoughtworks.selenium.Selenium

runScript

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

select

public void select(java.lang.String selectLocator,
                   java.lang.String optionLocator)
Specified by:
select in interface com.thoughtworks.selenium.Selenium

selectFrame

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

selectWindow

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

setBrowserLogLevel

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

setContext

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

setCursorPosition

public void setCursorPosition(java.lang.String locator,
                              java.lang.String position)
Specified by:
setCursorPosition in interface com.thoughtworks.selenium.Selenium

setExtensionJs

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

setMouseSpeed

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

setSpeed

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

setTimeout

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

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

showContextualBanner

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

showContextualBanner

public void showContextualBanner(java.lang.String className,
                                 java.lang.String methodName)
Specified by:
showContextualBanner in interface com.thoughtworks.selenium.Selenium

shutDownSeleniumServer

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

start

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

start

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

start

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

submit

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

type

public void type(java.lang.String locator,
                 java.lang.String value)
Specified by:
type in interface com.thoughtworks.selenium.Selenium

typeKeys

public void typeKeys(java.lang.String locator,
                     java.lang.String value)
Specified by:
typeKeys in interface com.thoughtworks.selenium.Selenium

uncheck

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

useXpathLibrary

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

waitForCondition

public void waitForCondition(java.lang.String script,
                             java.lang.String timeout)
Specified by:
waitForCondition in interface com.thoughtworks.selenium.Selenium

waitForFrameToLoad

public void waitForFrameToLoad(java.lang.String frameAddress,
                               java.lang.String timeout)
Specified by:
waitForFrameToLoad in interface com.thoughtworks.selenium.Selenium

waitForPageToLoad

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

waitForPopUp

public void waitForPopUp(java.lang.String windowID,
                         java.lang.String timeout)
Specified by:
waitForPopUp 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

stop

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

addCustomRequestHeader

public void addCustomRequestHeader(java.lang.String arg0,
                                   java.lang.String arg1)
Specified by:
addCustomRequestHeader in interface com.thoughtworks.selenium.Selenium

captureNetworkTraffic

public java.lang.String captureNetworkTraffic(java.lang.String arg0)
Specified by:
captureNetworkTraffic in interface com.thoughtworks.selenium.Selenium

deselectPopUp

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

selectPopUp

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

verifyEquals

public void verifyEquals(java.lang.Object obj1,
                         java.lang.Object obj2)
Description copied from class: ZKSeleneseTestCase
Like assertEquals, but fails at the end of the test (during tearDown)

Overrides:
verifyEquals in class ZKSeleneseTestCase

verifyContains

public void verifyContains(java.lang.String word1,
                           java.lang.String contains)

verifyNotContains

public void verifyNotContains(java.lang.String word1,
                              java.lang.String contains)

sleep

protected void sleep(long millis)
Causes the currently executing thread to sleep for the specified number of milliseconds, subject to the precision and accuracy of system timers and schedulers. The thread does not lose ownership of any monitors.

Parameters:
millis - the length of time to sleep in milliseconds.

verifyImage

public void verifyImage(Comparator comparator)
Parameters:
comparator - an image comparator.

verifyImage

public void verifyImage()
Compares the snapshot of the testing result. It is decided by the config.properties comparable.

If true, it will load base image from the specified path, and compare the current screen shot of the testing result. Otherwise, it just captures the current screen shot and put into the base image path.

The default comparator is to use Defaultcomparator. You can also use verifyImage(Comparator) to specify your own comparator.

See Also:
DefaultComparator

getCssCount

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

getLog

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

open

public void open(java.lang.String arg0,
                 java.lang.String arg1)
Specified by:
open in interface com.thoughtworks.selenium.Selenium


Copyright © 2014. All Rights Reserved.