Table of Contents

Class ExecuteJavaScriptBuilderBase

Namespace
CSF.Screenplay.Selenium.Builders
Assembly
CSF.Screenplay.Selenium.dll

Base type for a builder which facilitates the execution of JavaScript in the web browser.

public abstract class ExecuteJavaScriptBuilderBase
Inheritance
ExecuteJavaScriptBuilderBase
Derived
Inherited Members

Constructors

ExecuteJavaScriptBuilderBase(string)

Initialises a new instance of this builder.

protected ExecuteJavaScriptBuilderBase(string scriptBody)

Parameters

scriptBody string

The body of the JavaScript to be executed.

Exceptions

ArgumentException

If scriptBody is null or a whitepace-only string

Properties

Arguments

Gets a collection of the arguments to be provided to the script.

protected object[] Arguments { get; }

Property Value

object[]

Name

Gets the human-readable name of the script.

protected string Name { get; }

Property Value

string

ScriptBody

Gets the body of the script to be executed.

protected string ScriptBody { get; }

Property Value

string

Methods

WithTheArguments(params object[])

Sets the arguments (parameters) for the script.

public ExecuteJavaScriptBuilderBase WithTheArguments(params object[] arguments)

Parameters

arguments object[]

A collection of parameter values

Returns

ExecuteJavaScriptBuilderBase

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 ExecuteJavaScriptBuilderBase WithTheName(string name)

Parameters

name string

The human-readable name for the script

Returns

ExecuteJavaScriptBuilderBase

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