|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface UnsupportedTypedSelenium
Unsupported methods from Selenium API didn't exposed to TypedSelenium
| Method Summary | |
|---|---|
void |
addCustomRequestHeader(String key,
String value)
Tells the Selenium server to add the specificed key and value as a custom outgoing request header. |
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 |
|---|
void addCustomRequestHeader(String key,
String value)
key - the header name.value - the header value.
void attachFile(ElementLocator<?> fieldLocator,
File fileLocator)
fieldLocator - an element locatorfileLocator - 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.
void attachFile(ElementLocator<?> fieldLocator,
URL fileLocator)
fieldLocator - an element locatorfileLocator - 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.void captureScreenshot(File filename)
filename - the absolute path to the file to be written, e.g. "c:\blah\screenshot.png"void captureEntirePageScreenshot(File filename)
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.List<ElementLocator<?>> getAllButtons()
If a given button has no ID, it will appear as "" in this array.
List<ElementLocator<?>> getAllLinks()
If a given link has no ID, it will appear as "" in this array.
List<ElementLocator<?>> getAllFields()
If a given field has no ID, it will appear as "" in this array.
List<WindowId> getAllWindowIds()
List<String> getAllWindowNames()
List<String> getAllWindowTitles()
List<String> getAttributeFromAllWindows(Attribute attribute)
attributeName - name of an attribute on the windows
JavaScript getExpression(JavaScript expression)
This is useful because of JavaScript preprocessing. It is used to generate commands like assertExpression and waitForExpression.
expression - the value to return
boolean getWhetherThisFrameMatchFrameExpression(Frame currentFrame,
Frame targetFrame)
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.
currentFrameString - starting frametarget - new frame (which might be relative to the current one)
boolean getWhetherThisWindowMatchWindowExpression(Window currentWindowString,
Window target)
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.
currentWindowString - starting windowtarget - new window (which might be relative to the current one, e.g., "_parent")
void openWindow(URL url,
WindowId windowID)
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").
url - the URL to open, which can be blankwindowID - the JavaScript window ID of the window to selectvoid selectPopUp(WindowId windowID)
selectWindow() already provides).
windowID is either not specified, or specified as "null", the first non-top window is
selected. The top window is the one that would be selected by selectWindow() without providing a
windowID . This should not be used when more than one popup window is in play.windowID as the following in order: 1) the
"name" of the window, as specified to window.open(); 2) a javascript variable which is a reference
to a window; and 3) the title of the window. This is the same ordered lookup performed by
selectWindow .
windowID - an identifier for the popup window, which can take on a number of different meaningsvoid selectWindow(WindowId windowID)
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").
windowID - the JavaScript window ID of the window to selectvoid setExtensionJs(JavaScript extensionJs)
void waitForPopUp(WindowId windowId,
long timeoutInMilis)
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).timeout - 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||