Sie sind auf Seite 1von 3

Field Type Command Description

Open a URL in test frame open ( url ) url - the URL to open; may be relative or absolute.
Refresh the browser refresh ( ) Simulates the user clicking the "Refresh" button on their browser.
Textfields, text area type ( locator,value ) Can also be used to set the value of combo boxes, check boxes, etc. In these cases, value
should be the value of the option selected, not the visible text.
* locator - an element locator
* value - the value to type

dropdown select ( selectLocator,optionLocator ) * selectLocator - an element locator identifying a drop-down menu


* optionLocator - an option locator (a label by default).
Radio check ( locator ) || click(locator) clicking for the radio button.
Checkbox check ( locator ) || click(locator) checking the checkbox.
Checkbox || Radio uncheck ( locator ) Uncheck a toggle-button (checkbox/radio)
*locator - an element locator.
Link click ( locator ) clicking on the link.
button click ( locator ) clicking on the button.
link, button, checkbox or radio clickAt ( locator,coordString ) * locator - an element locator * coordString - specifies the x,y position (i.e. - 10,20) of
the mouse event relative to the element returned by the locator.

Submitting form submit ( formLocator ) Submit the specified form. This is particularly useful for forms without submit buttons,
e.g. single-input "Search" forms.
* formLocator - an element locator for the form you want to submit.
Firing an event fireEvent ( locator,eventName ) Explicitly simulate an event, to trigger the corresponding "onevent" handler.
* locator - an element locator
* eventName - the event name, e.g. "focus" or "blur".

Wait for Page to load waitForPageToLoad ( timeout ) Waits for a new page to load.
* timeout - a timeout in milliseconds, after which this returns with an error.

Timeout setTimeout ( timeout ) Specifies the amount of time that Selenium will wait for actions to complete.
Actions that require waiting include "open" and the "waitFor*" actions.
The default timeout is 30 seconds.
* timeout - a timeout in milliseconds, after which the action will return with n error

Browser go back goBack ( ) Simulates the user clicking the "back" button on their browser
closing popup or tab close ( ) Simulates the user clicking the "close" button in the titlebar of a popup window or tab.

Select Frame selectFrame ( locator ) Selects a frame within the current window.
* locator - an element locator identifying a frame or iframe
Select Window selectWindow ( windowID ) once a popup window has been selected, all commands go to that window. To select the
main window again, use "null" as the target.
* windowID - the JavaScript window ID of the window to select
For logging setContext ( context,logLevelThreshold ) Writes a message to the status bar and adds a note to the browser-side log.
If logLevelThreshold is specified, set the threshold for logging to that level (debug, info,
warn, error). (Note that the browser-side logs will not be sent back to the server, and are
invisible to the Client Driver.)
Arguments:
* context - the message to be sent to the browser
* logLevelThreshold - one of "debug", "info", "warn", "error", sets the threshold for
browser-side logging

Set cursor setCursorPosition ( locator,position ) * locator - an element locator pointing to an input element or textarea
* position - the numerical position of the cursor in the field; position should be 0 to
move the position to the beginning of the field. You can also set the cursor to -1 to move
it to the end of the field.

Simulates a user pressing a key keyDown ( locator,keySequence ) * locator - an element locator For example: "w", "\119".
(without releasing it yet). * keySequence - Either be a string("\" followed by the numeric keycode of the key to
be pressed, the ASCII value of that key), or a single character.

Simulates a user pressing keyPress ( locator,keySequence ) * locator - an element locator For example: "w", "\119".
and releasing a key. * keySequence - Either be a string("\" followed by the numeric keycode of the key to
be pressed, the ASCII value of that key), or a single character.

Simulates a user releasing keyUp ( locator,keySequence ) * locator - an element locator For example: "w", "\119".
a key. * keySequence - Either be a string("\" followed by the numeric keycode of key to be
pressed, the ASCII value of key), or a single character.

Multi-selector addSelection ( locator,optionLocator ) Add one more selection to multiselector.


MultiSelect removeSelection * locator - an element locator identifying a multi-select box
( locator,optionLocator ) * optionLocator - an option locator (a label by default)
window.Prompt() answerOnNextPrompt Instructs Selenium to return the specified answer string in response to the next
JavaScript prompt [window.prompt()].
window.confirm() chooseCancelOnNextConfirmation ( ) By default, Selenium's overridden window.confirm() function will return true, as if the
user had manually clicked OK. After running this command, the next call to confirm() will
return false, as if the user had clicked Cancel.

Create Cookie createCookie * nameValuePair - name and value of the cookie "name=value" format
( nameValuePair,optionsString ) * optionsString - options for the cookie. Currently supported options include 'path' and
'max_age'. the optionsString's format is "path=/path/, max_age=60". The order of
options are irrelevant, unit of 'max_age' is sec.

Delete Cookie deleteCookie ( name,path ) * name - the name of the cookie to be deleted
* path - the path property of the cookie to be deleted.
Drag and drop dragdrop ( locator,movementsString ) * locator - an element locator
* movementsString - offset in pixels from the current location to which the element
should be moved, e.g., "+70,-300"
Wait for condition using waitForCondition ( script,timeout ) Runs the JavaScript snippet repeatedly until it evaluates to "true". snippet may have
the javascript snippet multiple lines, but only result of last line will be considered.
* script - the JavaScript snippet to run
* timeout - a timeout in milliseconds, after this returns with an error.

Wait for Popup waitForPopUp ( windowID,timeout ) Waits for a popup window to appear and load up.
* windowID - the JavaScript window ID of the window that will appear
* timeout - a timeout in milliseconds, after this action returns an error

Focusing on windows windowFocus ( windowName ) Gives focus to a window


* windowName - name of the window to be given focus
Maximizing windows windowMaximize ( windowName ) Resize window to take up the entire screen
* windowName - name of the window to be enlarged
Field Type Command
Open a URL in test frame open ( url )
Refresh the browser refresh ( )
Textfields, text area type ( locator,value )
dropdown select ( selectLocator,optionLocator )
Radio check ( locator ) || click(locator)
Checkbox check ( locator ) || click(locator)
Checkbox || Radio uncheck ( locator )
Link click ( locator )
button click ( locator )
link, button, checkbox or radio clickAt ( locator,coordString )
Submitting form submit ( formLocator )
Firing an event fireEvent ( locator,eventName )
Wait for Page to load waitForPageToLoad ( timeout )
Timeout setTimeout ( timeout )
Browser go back goBack ( )
closing popup or tab close ( )
Select Frame selectFrame ( locator )
Select Window selectWindow ( windowID )
For logging setContext ( context,logLevelThreshold )
Set cursor setCursorPosition ( locator,position )
Simulates a user pressing a key keyDown ( locator,keySequence )
(without releasing it yet).
Simulates a user pressing keyPress ( locator,keySequence )
and releasing a key.
Simulates user releasing a key. keyUp ( locator,keySequence )
Multi-selector addSelection ( locator,optionLocator )
MultiSelect removeSelection
( locator,optionLocator )
window.Prompt() answerOnNextPrompt
window.confirm() chooseCancelOnNextConfirmation ( )
Create Cookie createCookie(nameValuePair,optionsString )
Delete Cookie deleteCookie ( name,path )
Drag and drop dragdrop ( locator,movementsString )
Wait for condition using waitForCondition ( script,timeout )
the javascript snippet
Wait for Popup waitForPopUp ( windowID,timeout )
Focusing on windows windowFocus ( windowName )
Maximizing windows windowMaximize ( windowName )

Das könnte Ihnen auch gefallen