Ajocado Implementation 1.0.0.Alpha2

org.jboss.arquillian.ajocado.framework.internal
Interface UnsupportedTypedSelenium

All Known Implementing Classes:
AjaxSeleniumImpl, ExtendedTypedSeleniumImpl, TypedSeleniumImpl

public interface UnsupportedTypedSelenium

Unsupported methods from Selenium API didn't exposed to TypedSelenium

Version:
$Revision$
Author:
Lukas Fryc

Method Summary
 void attachFile(ElementLocator<?> fieldLocator, File fileLocator)
          Sets a file input (upload) field to the file listed in fileLocator
 void attachFile(ElementLocator<?> fieldLocator, URL fileLocator)
          Sets a file input (upload) field to the file listed in fileLocator
 void captureEntirePageScreenshot(File filename)
          Saves the entire contents of the current window canvas to a PNG file.
 void captureScreenshot(File filename)
          Captures a PNG screenshot to the specified file.
 List<ElementLocator<?>> getAllButtons()
          Returns the IDs of all buttons on the page.
 List<ElementLocator<?>> getAllFields()
          Returns the IDs of all input fields on the page.
 List<ElementLocator<?>> getAllLinks()
          Returns the IDs of all links on the page.
 List<WindowId> getAllWindowIds()
          Returns the IDs of all windows that the browser knows about.
 List<String> getAllWindowNames()
          Returns the names of all windows that the browser knows about.
 List<String> getAllWindowTitles()
          Returns the titles of all windows that the browser knows about.
 List<String> getAttributeFromAllWindows(Attribute attribute)
          Returns every instance of some attribute from all known windows.
 JavaScript getExpression(JavaScript expression)
          Returns the specified expression.
 boolean getWhetherThisFrameMatchFrameExpression(Frame currentFrame, Frame targetFrame)
          Determine whether current/locator identify the frame containing this running code.
 boolean getWhetherThisWindowMatchWindowExpression(Window currentWindowString, Window target)
          Determine whether currentWindowString plus target identify the window containing this running code.
 void openWindow(URL url, WindowId windowID)
          Opens a popup window (if a window with that ID isn't already open).
 void selectPopUp(WindowId windowID)
          Simplifies the process of selecting a popup window (and does not offer functionality beyond what selectWindow() already provides).
 void selectWindow(WindowId windowID)
          Selects a popup window using a window locator; once a popup window has been selected, all commands go to that window.
 void setExtensionJs(JavaScript extensionJs)
          Sets the per-session extension Javascript
 void waitForPopUp(WindowId windowId, long timeoutInMilis)
          Waits for a popup window to appear and load up.
 

Method Detail

attachFile

void attachFile(ElementLocator<?> fieldLocator,
                File fileLocator)
Sets a file input (upload) field to the file listed in fileLocator

Parameters:
fieldLocator - an element locator
fileLocator - a URL pointing to the specified file. Before the file can be set in the input field (fieldLocator), Selenium RC may need to transfer the file to the local machine before attaching the file in a web page form. This is common in selenium grid configurations where the RC server driving the browser is not the same machine that started the test. Supported Browsers: Firefox ("*chrome") only.

attachFile

void attachFile(ElementLocator<?> fieldLocator,
                URL fileLocator)
Sets a file input (upload) field to the file listed in fileLocator

Parameters:
fieldLocator - an element locator
fileLocator - a URL pointing to the specified file. Before the file can be set in the input field (fieldLocator), Selenium RC may need to transfer the file to the local machine before attaching the file in a web page form. This is common in selenium grid configurations where the RC server driving the browser is not the same machine that started the test. Supported Browsers: Firefox ("*chrome") only.

captureScreenshot

void captureScreenshot(File filename)
Captures a PNG screenshot to the specified file.

Parameters:
filename - the absolute path to the file to be written, e.g. "c:\blah\screenshot.png"

captureEntirePageScreenshot

void captureEntirePageScreenshot(File filename)
Saves the entire contents of the current window canvas to a PNG file. Contrast this with the captureScreenshot command, which captures the contents of the OS viewport (i.e. whatever is currently being displayed on the monitor), and is implemented in the RC only. Currently this only works in Firefox when running in chrome mode, and in IE non-HTA using the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension. Please see http://www.screengrab.org and http://snapsie.sourceforge.net/ for details.

Parameters:
filename - the path to the file to persist the screenshot as. No filename extension will be appended by default. Directories will not be created if they do not exist, and an exception will be thrown, possibly by native code.

getAllButtons

List<ElementLocator<?>> getAllButtons()
Returns the IDs of all buttons on the page.

If a given button has no ID, it will appear as "" in this array.

Returns:
the IDs of all buttons on the page

getAllLinks

List<ElementLocator<?>> getAllLinks()
Returns the IDs of all links on the page.

If a given link has no ID, it will appear as "" in this array.

Returns:
the IDs of all links on the page

getAllFields

List<ElementLocator<?>> getAllFields()
Returns the IDs of all input fields on the page.

If a given field has no ID, it will appear as "" in this array.

Returns:
the IDs of all field on the page

getAllWindowIds

List<WindowId> getAllWindowIds()
Returns the IDs of all windows that the browser knows about.

Returns:
the IDs of all windows that the browser knows about.

getAllWindowNames

List<String> getAllWindowNames()
Returns the names of all windows that the browser knows about.

Returns:
the names of all windows that the browser knows about.

getAllWindowTitles

List<String> getAllWindowTitles()
Returns the titles of all windows that the browser knows about.

Returns:
the titles of all windows that the browser knows about.

getAttributeFromAllWindows

List<String> getAttributeFromAllWindows(Attribute attribute)
Returns every instance of some attribute from all known windows.

Parameters:
attribute - name of an attribute on the windows
Returns:
the set of values of this attribute from all known windows.

getExpression

JavaScript getExpression(JavaScript expression)
Returns the specified expression.

This is useful because of JavaScript preprocessing. It is used to generate commands like assertExpression and waitForExpression.

Parameters:
expression - the value to return
Returns:
the value passed in

getWhetherThisFrameMatchFrameExpression

boolean getWhetherThisFrameMatchFrameExpression(Frame currentFrame,
                                                Frame targetFrame)
Determine whether current/locator identify the frame containing this running code.

This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" frame. In this case, when the test calls selectFrame, this routine is called for each frame to figure out which one has been selected. The selected frame will return true, while all others will return false.

Parameters:
currentFrame - starting frame
targetFrame - new frame (which might be relative to the current one)
Returns:
true if the new frame is this code's window

getWhetherThisWindowMatchWindowExpression

boolean getWhetherThisWindowMatchWindowExpression(Window currentWindowString,
                                                  Window target)
Determine whether currentWindowString plus target identify the window containing this running code.

This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" window. In this case, when the test calls selectWindow, this routine is called for each window to figure out which one has been selected. The selected window will return true, while all others will return false.

Parameters:
currentWindowString - starting window
target - new window (which might be relative to the current one, e.g., "_parent")
Returns:
true if the new window is this code's window

openWindow

void openWindow(URL url,
                WindowId windowID)
Opens a popup window (if a window with that ID isn't already open). After opening the window, you'll need to select it using the selectWindow command.

This command can also be a useful workaround for bug SEL-339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow").

Parameters:
url - the URL to open, which can be blank
windowID - the JavaScript window ID of the window to select

selectPopUp

void selectPopUp(WindowId windowID)
Simplifies the process of selecting a popup window (and does not offer functionality beyond what selectWindow() already provides).

Parameters:
windowID - an identifier for the popup window, which can take on a number of different meanings

selectWindow

void selectWindow(WindowId windowID)
Selects a popup window using a window locator; once a popup window has been selected, all commands go to that window. To select the main window again, use null as the target.

Window locators provide different ways of specifying the window object: by title, by internal JavaScript "name," or by JavaScript variable.

If no window locator prefix is provided, we'll try to guess what you mean like this:

1.) if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser).

2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed that this variable contains the return value from a call to the JavaScript window.open() method.

3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names".

4.) If that fails, we'll try looping over all of the known windows to try to find the appropriate "title". Since "title" is not necessarily unique, this may have unexpected behavior.

If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages like the following for each window as it is opened:

debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"

In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow").

Parameters:
windowID - the JavaScript window ID of the window to select

setExtensionJs

void setExtensionJs(JavaScript extensionJs)
Sets the per-session extension Javascript

Parameters:
extensionJs -

waitForPopUp

void waitForPopUp(WindowId windowId,
                  long timeoutInMilis)
Waits for a popup window to appear and load up.

Parameters:
windowId - the JavaScript window "name" of the window that will appear (not the text of the title bar) If unspecified, or specified as "null", this command will wait for the first non-top window to appear (don't rely on this if you are working with multiple popups simultaneously).
timeoutInMilis - a timeout in milliseconds, after which the action will return with an error. If this value is not specified, the default Selenium timeout will be used. See the setTimeout() command.

Ajocado Implementation 1.0.0.Alpha2

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.