Table of Contents

Class AsyncJavaScriptExecutor

Namespace
OpenQA.Selenium.Internal
Assembly
WebDriver.dll

Utility class used to execute "asynchronous" scripts. This class should only be used by browsers that do not natively support asynchronous script execution.

Warning: this class is intended for internal use only. This class will be removed without warning after all native asynchronous implementations have been completed.

public class AsyncJavaScriptExecutor
Inheritance
AsyncJavaScriptExecutor
Inherited Members

Constructors

AsyncJavaScriptExecutor(IJavaScriptExecutor)

Initializes a new instance of the AsyncJavaScriptExecutor class.

public AsyncJavaScriptExecutor(IJavaScriptExecutor executor)

Parameters

executor IJavaScriptExecutor

An IJavaScriptExecutor object capable of executing JavaScript.

Properties

Timeout

Gets or sets the timeout for the script executor.

public TimeSpan Timeout { get; set; }

Property Value

TimeSpan

Methods

ExecuteScript(string, object[])

Executes a JavaScript script asynchronously.

public object ExecuteScript(string script, object[] args)

Parameters

script string

The script to execute.

args object[]

An array of objects used as arguments in the script.

Returns

object

The object which is the return value of the script.

Exceptions

InvalidOperationException

if the object executing the function doesn't support JavaScript.

WebDriverException

if the page reloads during the JavaScript execution.

WebDriverTimeoutException

if the timeout expires during the JavaScript execution.