Classes
Methods
getActions() → {SeleniumActions}
Retrieves the current action sequence builder. The actions builder can be used to chain multiple browser actions.
Returns:
The current Selenium Actions builder object for chaining browser actions.
- Type:
- SeleniumActions
Example
// Example of using the actions builder to perform a drag-and-drop operation:
+ On this pageActions
This class provides an abstraction layer for Selenium's action sequence functionality. It allows for easy interaction with web elements using different locating strategies and simulating complex user gestures like mouse movements, key presses, etc.
Classes
Methods
getActions() → {SeleniumActions}
Retrieves the current action sequence builder. The actions builder can be used to chain multiple browser actions.Returns:The current Selenium Actions builder object for chaining browser actions.- Type:
- SeleniumActions
Example// Example of using the actions builder to perform a drag-and-drop operation:
const elementToDrag = await commands.action.getElementByCss('.draggable');
const dropTarget = await commands.action.getElementByCss('.drop-target');
await commands.action.getAction()
diff --git a/docs/documentation/sitespeed.io/scripting/AddText.html b/docs/documentation/sitespeed.io/scripting/AddText.html
index 95ca1d3b6..6900822e0 100644
--- a/docs/documentation/sitespeed.io/scripting/AddText.html
+++ b/docs/documentation/sitespeed.io/scripting/AddText.html
@@ -1,3 +1,3 @@
Class: AddText On this pageAddText
Provides functionality to add text to elements on a web page using various selectors.Classes
Methods
(async) byClassName(text, className) → {Promise.<void>}
Adds text to an element identified by its class name.Parameters:Name Type Description textstring The text string to add. classNamestring The class name of the element.
Throws:- Throws an error if the element is not found.
- Type
- Error
Returns:A promise that resolves when the text has been added.- Type:
- Promise.<void>
Examplecommands.addText.byClassName('mytext', 'className');
(async) byId(text, id) → {Promise.<void>}
Adds text to an element identified by its ID.Parameters:Name Type Description textstring The text string to add. idstring The ID of the element.
Throws:- Throws an error if the element is not found.
- Type
- Error
Returns:A promise that resolves when the text has been added.- Type:
- Promise.<void>
Examplecommands.addText.byId('mytext', 'id');
(async) byName(text, name) → {Promise.<void>}
Adds text to an element identified by its name attribute.Parameters:Name Type Description textstring The text string to add. namestring The name attribute of the element.
Throws:- Throws an error if the element is not found.
- Type
- Error
Returns:A promise that resolves when the text has been added.- Type:
- Promise.<void>
Examplecommands.addText.byName('mytext', 'name');
(async) bySelector(text, selector) → {Promise.<void>}
Adds text to an element identified by its CSS selector.Parameters:Name Type Description textstring The text string to add. selectorstring The CSS selector of the element.
Throws:- Throws an error if the element is not found.
- Type
- Error
Returns:A promise that resolves when the text has been added.- Type:
- Promise.<void>
Examplecommands.addText.bySelector('mytext', 'selector');
(async) byXpath(text, xpath) → {Promise.<void>}
Adds text to an element identified by its XPath.Parameters:Name Type Description textstring The text string to add. xpathstring The XPath of the element.
Throws:- Throws an error if the element is not found.
- Type
- Error
Returns:A promise that resolves when the text has been added.- Type:
- Promise.<void>
Examplecommands.addText.byXpath('mytext', 'xpath');
\ No newline at end of file
+ On this pageAddText
Provides functionality to add text to elements on a web page using various selectors.Classes
Methods
(async) byClassName(text, className) → {Promise.<void>}
Adds text to an element identified by its class name.Parameters:Name Type Description textstring The text string to add. classNamestring The class name of the element.
Throws:- Throws an error if the element is not found.
- Type
- Error
Returns:A promise that resolves when the text has been added.- Type:
- Promise.<void>
Examplecommands.addText.byClassName('mytext', 'className');
(async) byId(text, id) → {Promise.<void>}
Adds text to an element identified by its ID.Parameters:Name Type Description textstring The text string to add. idstring The ID of the element.
Throws:- Throws an error if the element is not found.
- Type
- Error
Returns:A promise that resolves when the text has been added.- Type:
- Promise.<void>
Examplecommands.addText.byId('mytext', 'id');
(async) byName(text, name) → {Promise.<void>}
Adds text to an element identified by its name attribute.Parameters:Name Type Description textstring The text string to add. namestring The name attribute of the element.
Throws:- Throws an error if the element is not found.
- Type
- Error
Returns:A promise that resolves when the text has been added.- Type:
- Promise.<void>
Examplecommands.addText.byName('mytext', 'name');
(async) bySelector(text, selector) → {Promise.<void>}
Adds text to an element identified by its CSS selector.Parameters:Name Type Description textstring The text string to add. selectorstring The CSS selector of the element.
Throws:- Throws an error if the element is not found.
- Type
- Error
Returns:A promise that resolves when the text has been added.- Type:
- Promise.<void>
Examplecommands.addText.bySelector('mytext', 'selector');
(async) byXpath(text, xpath) → {Promise.<void>}
Adds text to an element identified by its XPath.Parameters:Name Type Description textstring The text string to add. xpathstring The XPath of the element.
Throws:- Throws an error if the element is not found.
- Type
- Error
Returns:A promise that resolves when the text has been added.- Type:
- Promise.<void>
Examplecommands.addText.byXpath('mytext', 'xpath');
\ No newline at end of file
diff --git a/docs/documentation/sitespeed.io/scripting/AndroidCommand.html b/docs/documentation/sitespeed.io/scripting/AndroidCommand.html
index 88a872fad..07ae20902 100644
--- a/docs/documentation/sitespeed.io/scripting/AndroidCommand.html
+++ b/docs/documentation/sitespeed.io/scripting/AndroidCommand.html
@@ -1,3 +1,3 @@
Class: AndroidCommand On this pageAndroidCommand
Provides functionality to interact with an Android device through shell commands.Classes
Methods
(async) shell(command) → {Promise.<string>}
Runs a shell command on the connected Android device. This method requires the Android device to be properly configured.Parameters:Name Type Description commandstring The shell command to run on the Android device.
Throws:- Throws an error if Android is not configured or if the command fails.
- Type
- Error
Returns:A promise that resolves with the result of the command or rejects if there's an error.- Type:
- Promise.<string>
Exampleawait commands.android.shell('');
(async) shellAsRoot(command) → {Promise.<string>}
Runs a shell command on the connected Android device as the root user. This method requires the Android device to be properly configured and that you rooted the device.Parameters:Name Type Description commandstring The shell command to run on the Android device as root.
Throws:- Throws an error if Android is not configured or if the command fails.
- Type
- Error
Returns:A promise that resolves with the result of the command or rejects if there's an error.- Type:
- Promise.<string>
Exampleawait commands.android.shellAsRoot('');
\ No newline at end of file
+ On this pageAndroidCommand
Provides functionality to interact with an Android device through shell commands.Classes
Methods
(async) shell(command) → {Promise.<string>}
Runs a shell command on the connected Android device. This method requires the Android device to be properly configured.Parameters:Name Type Description commandstring The shell command to run on the Android device.
Throws:- Throws an error if Android is not configured or if the command fails.
- Type
- Error
Returns:A promise that resolves with the result of the command or rejects if there's an error.- Type:
- Promise.<string>
Exampleawait commands.android.shell('');
(async) shellAsRoot(command) → {Promise.<string>}
Runs a shell command on the connected Android device as the root user. This method requires the Android device to be properly configured and that you rooted the device.Parameters:Name Type Description commandstring The shell command to run on the Android device as root.
Throws:- Throws an error if Android is not configured or if the command fails.
- Type
- Error
Returns:A promise that resolves with the result of the command or rejects if there's an error.- Type:
- Promise.<string>
Exampleawait commands.android.shellAsRoot('');