Class ExecuteJavaScriptBuilder
- Namespace
- CSF.Screenplay.Selenium.Builders
- Assembly
- CSF.Screenplay.Selenium.dll
A builder type for executing JavaScript in the browser which is not expected to return a result value.
public class ExecuteJavaScriptBuilder : ExecuteJavaScriptBuilderBase, IGetsPerformable
- Inheritance
-
ExecuteJavaScriptBuilder
- Implements
- Inherited Members
Constructors
ExecuteJavaScriptBuilder(string)
Initialises a new instance of ExecuteJavaScriptBuilder.
public ExecuteJavaScriptBuilder(string scriptBody)
Parameters
scriptBodystringThe body of the JavaScript to be executed.
Exceptions
- ArgumentException
If
scriptBodyis null or a whitepace-only string
Methods
WithTheArguments(params object[])
Sets the arguments (parameters) for the script.
public ExecuteJavaScriptBuilder WithTheArguments(params object[] arguments)
Parameters
argumentsobject[]A collection of parameter values
Returns
- ExecuteJavaScriptBuilder
This same builder object, so calls may be chained
Remarks
This method is optional; if the script requires no parameters then it is unneccesary to use this method.
Exceptions
- InvalidOperationException
If the arguments have already been set
WithTheName(string)
Sets a human-readable name for the script, which may be displayed in Screenplay reports.
public ExecuteJavaScriptBuilder WithTheName(string name)
Parameters
namestringThe human-readable name for the script
Returns
- ExecuteJavaScriptBuilder
This same builder object, so calls may be chained
Exceptions
- ArgumentException
If the name is null or a whitepace-only string
- InvalidOperationException
If the name has already been set