Fetches an element and performs the native .blur()
in the browser.
That means that this element will lose the focus-state.
Resolves when browser-script finished
Performs a click on a checkbox input and forces its state to be checked
_click simulates a user's click on the given element.
query to the Element to click on
Optional combo key(s): can be CTRL, SHIFT, ALT or META;
Can also be two or more keys together like "CTRL|SHIFT"
disables validations prior to the click action to enforce clicks where an element e.g. is covered
Resolves after the click is invoked, doesn't wait for further actions on the website which are possibly invoked after the click
Performs a mouse down on eSource, than moves the mouse to the position of element eTarget and releases the mouse button at this position.
This implementation uses Webdriver actions which does not always behave as expected.
For a more reliable experience ThenableRegion.dragAndDropTo is recommended.
Performs a mouse down on eSource, than moves the mouse to the position P(x,y) in the browsers' viewport and releases the mouse button at this position.
This implementation uses Webdriver actions which does not always behave as expected.
For a more reliable experience ThenableRegion.dragAndDropTo is recommended.
This function sends Javascript to the browser which is executed their. you can pass a list of arguments to this script.
The function is using ThenableWebdriver.executeScript internally.
All element queries in the _args
list (e.g. _div('Hello')
) are resolved to WebElements and are available as a HTMLElement in the script
All _args
are available in the arguments
array in the script.
the return value of the JavaScript is returned from this function.
Javascript code which is executed in the browser
A variadic list of arguments that are passed to Javascript
Fetches an element and performs the native .focus()
method in the browser.
When _focus
is performed on an <input>
element, it will be automatically scrolled into the viewport by the browser.
Note that not all elements will get an actual focus in the browser.
Usually links and user-controls (e.g. <input>
, <textarea>
, <select>
...) can gain focus.
Query or concrete WebElement
Resolves when browser-script finished
Draws a red border around an element on the website.
This is useful for debugging and demonstrating reasons. Note that the timeout of this highlight will increase the actual execution time of the current step.
The element to be highlighted
determine how long the highlight will last (default: 2000
)
Invokes a single keydown
event on the given element.
This is useful if you want to invoke a certain event which relies
on the keydown event. In most cases it has to be used together with KeyboardActionsApi._keyUp
Optional combo key(s): can be CTRL, SHIFT, ALT or META;
Can also be two or more keys together like "CTRL|SHIFT"
Performs a single keystroke ('keypress'
-event) on the element.
Optional combo key(s): can be CTRL, SHIFT, ALT or META;
Can also be two or more keys together like "CTRL|SHIFT"
Invokes a single keyup
event with the given element.
This is only useful when KeyboardActionsApi._keyDown is invoked previously. Some WebDrivers like Firefox will not trigger any event if there was no keypress before.
Performs a press
action on the element
Indicates that the right mousebutton is pressed
Any combo key: can be "CTRL", "SHIFT", "ALT" or "META"; Can also be two or more keys together like "CTRL|SHIFT"
Invokes a mouse over on the queried element. Can be combined with a key combo.
Optional combo key(s): can be CTRL, SHIFT, ALT or META;
Can also be two or more keys together like "CTRL|SHIFT"
Performs a release
action on the element.
Release is the action when a user releases his finger from the mouse button.
Indicates that the right mousebutton is released
Optional combo key(s): can be CTRL, SHIFT, ALT or META;
Can also be two or more keys together like "CTRL|SHIFT"
Navigates the browser instance to the given URL (also Data URLs are possible).
The URL of the Website to test - Could be any string that can be entered in a browser navigationbar
Forces the page to reload after it has been loaded - it is a relict of Sahi. Default: false
If a site requires "Http-Basic-Authentication" you can pass the credentials here
Continuously fetches the page source and checks for DOM changes. Will be repeated every $timeout milliseconds until either the DOM does no longer change or $timeout is reached
Maximum timout in ms to wait for DOM stabilization. Default: 2000 ms
Interval between stability checks in ms. Default: 200 ms
Performs a right click on the queried element. Can be combined with a key combo.
Any combo key: can be "CTRL", "SHIFT", "ALT" or "META"; Can also be two or more keys together like "CTRL|SHIFT"
Sets the options within a <select>
element.
Selection can be done by the actual values of an option or its zero-based element index.
This action will invoke a click on the option element which means that the selected state is not enforced. If an option is already selected, it will be unselected.
Sets a value on an <input />
field.
It will clear the existing value from the input before:
It will send each character from the value string to the input with an delay of 10 ms
using .sendKeys.
This ensures that components which rely on key-events (like keyup
or keydown
) will behave
as expected on the page.
When .sendKeys fails,
_setValue
will try to set the value attribute of the dom element.
Invokes .sendKeys on the given element.
It will neither type with a delay nor set the value
-attribute when the method fails.
Performs a click on a checkbox input and forces its state not to be checked
Wait for a maximum of the given timeout. It's also possible to pass an expression function which will be evaluated during the waiting.
Maximum amount of time to be waiting (in milliseconds)
An optional function which will abort the wait when it returns a truthy value
Collection of different user-input related actions that can be invoked within a web page during the test.
The action API consists of:
All methods of this interface are available as global functions in Sakuli tests.