org.unitils.selenium
Class ScreenshotTakingWebDriver

java.lang.Object
  extended by com.thoughtworks.selenium.DefaultSelenium
      extended by com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium
          extended by org.unitils.selenium.ScreenshotTakingWebDriver
All Implemented Interfaces:
com.thoughtworks.selenium.Selenium, org.openqa.selenium.HasCapabilities, org.openqa.selenium.internal.WrapsDriver

public class ScreenshotTakingWebDriver
extends com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium

Decorator for the WebDriverBackedSelenium class to handle screenshots

Since:
1.0.4
Author:
Jef Verelst

Field Summary
 
Fields inherited from class com.thoughtworks.selenium.DefaultSelenium
commandProcessor
 
Constructor Summary
ScreenshotTakingWebDriver(com.google.common.base.Supplier<org.openqa.selenium.WebDriver> maker, String baseUrl)
           
ScreenshotTakingWebDriver(org.openqa.selenium.WebDriver baseDriver, String baseUrl)
           
 
Method Summary
 void clickWithScreenshot(String locator)
           
 void clickWithScreenshotAt(String locator, String coordString)
           
 void saveScreenshot()
          Save a screenshot with a default name in the default folder.
 void saveScreenshot(File screenshotDir, String fileName)
          Store a screenshot with a specified name in a specified folder.
 void saveScreenshot(String fileName)
          Save a screenshot with a specified name in the default folder
 void waitForFrameToLoad(String frameAddress, String timeout)
           
 void waitForPageToLoad(String timeout)
           
 
Methods inherited from class com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium
getCapabilities, getWrappedDriver
 
Methods inherited from class com.thoughtworks.selenium.DefaultSelenium
addCustomRequestHeader, addLocationStrategy, addScript, addSelection, allowNativeXpath, altKeyDown, altKeyUp, answerOnNextPrompt, assignId, attachFile, captureEntirePageScreenshot, captureEntirePageScreenshotToString, captureNetworkTraffic, captureScreenshot, captureScreenshotToString, check, chooseCancelOnNextConfirmation, chooseOkOnNextConfirmation, click, clickAt, close, contextMenu, contextMenuAt, controlKeyDown, controlKeyUp, createCookie, deleteAllVisibleCookies, deleteCookie, deselectPopUp, doubleClick, doubleClickAt, dragAndDrop, dragAndDropToObject, dragdrop, fireEvent, focus, getAlert, getAllButtons, getAllFields, getAllLinks, getAllWindowIds, getAllWindowNames, getAllWindowTitles, getAttribute, getAttributeFromAllWindows, getBodyText, getConfirmation, getCookie, getCookieByName, getCssCount, getCursorPosition, getElementHeight, getElementIndex, getElementPositionLeft, getElementPositionTop, getElementWidth, getEval, getExpression, getHtmlSource, getLocation, getLog, getMouseSpeed, getPrompt, getSelectedId, getSelectedIds, getSelectedIndex, getSelectedIndexes, getSelectedLabel, getSelectedLabels, getSelectedValue, getSelectedValues, getSelectOptions, getSpeed, getTable, getText, getTitle, getValue, getWhetherThisFrameMatchFrameExpression, getWhetherThisWindowMatchWindowExpression, getXpathCount, goBack, highlight, ignoreAttributesWithoutValue, isAlertPresent, isChecked, isConfirmationPresent, isCookiePresent, isEditable, isElementPresent, isOrdered, isPromptPresent, isSomethingSelected, isTextPresent, isVisible, keyDown, keyDownNative, keyPress, keyPressNative, keyUp, keyUpNative, metaKeyDown, metaKeyUp, mouseDown, mouseDownAt, mouseDownRight, mouseDownRightAt, mouseMove, mouseMoveAt, mouseOut, mouseOver, mouseUp, mouseUpAt, mouseUpRight, mouseUpRightAt, open, open, openWindow, refresh, removeAllSelections, removeScript, removeSelection, retrieveLastRemoteControlLogs, rollup, runScript, select, selectFrame, selectPopUp, selectWindow, setBrowserLogLevel, setContext, setCursorPosition, setExtensionJs, setMouseSpeed, setSpeed, setTimeout, shiftKeyDown, shiftKeyUp, showContextualBanner, showContextualBanner, shutDownSeleniumServer, start, start, start, stop, submit, type, typeKeys, uncheck, useXpathLibrary, waitForCondition, waitForPopUp, windowFocus, windowMaximize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenshotTakingWebDriver

public ScreenshotTakingWebDriver(com.google.common.base.Supplier<org.openqa.selenium.WebDriver> maker,
                                 String baseUrl)

ScreenshotTakingWebDriver

public ScreenshotTakingWebDriver(org.openqa.selenium.WebDriver baseDriver,
                                 String baseUrl)
Method Detail

saveScreenshot

public void saveScreenshot()
Save a screenshot with a default name in the default folder.


saveScreenshot

public void saveScreenshot(String fileName)
Save a screenshot with a specified name in the default folder

Parameters:
fileName -

saveScreenshot

public void saveScreenshot(File screenshotDir,
                           String fileName)
Store a screenshot with a specified name in a specified folder.

Parameters:
screenshotDir -
fileName -

clickWithScreenshot

public void clickWithScreenshot(String locator)

clickWithScreenshotAt

public void clickWithScreenshotAt(String locator,
                                  String coordString)

waitForPageToLoad

public void waitForPageToLoad(String timeout)
Specified by:
waitForPageToLoad in interface com.thoughtworks.selenium.Selenium
Overrides:
waitForPageToLoad in class com.thoughtworks.selenium.DefaultSelenium

waitForFrameToLoad

public void waitForFrameToLoad(String frameAddress,
                               String timeout)
Specified by:
waitForFrameToLoad in interface com.thoughtworks.selenium.Selenium
Overrides:
waitForFrameToLoad in class com.thoughtworks.selenium.DefaultSelenium


Copyright © 2014. All Rights Reserved.