Table of Contents

Class CallFunctionOnCommandSettings

Namespace
OpenQA.Selenium.DevTools.V146.Runtime
Assembly
Selenium.WebDriver.dll

Calls function with given declaration on the given object. Object group of the result is inherited from the target object.

public sealed class CallFunctionOnCommandSettings : ICommand
Inheritance
CallFunctionOnCommandSettings
Implements
Inherited Members

Properties

Arguments

Call arguments. All call arguments must belong to the same JavaScript world as the target object.

[JsonPropertyName("arguments")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public CallArgument[]? Arguments { get; set; }

Property Value

CallArgument[]

AwaitPromise

Whether execution should await for resulting value and return once awaited promise is resolved.

[JsonPropertyName("awaitPromise")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool? AwaitPromise { get; set; }

Property Value

bool?

CommandName

Gets the name of the command.

[JsonIgnore]
public string CommandName { get; }

Property Value

string

ExecutionContextId

Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified.

[JsonPropertyName("executionContextId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public long? ExecutionContextId { get; set; }

Property Value

long?

FunctionDeclaration

Declaration of the function to call.

[JsonPropertyName("functionDeclaration")]
public string FunctionDeclaration { get; set; }

Property Value

string

GeneratePreview

Whether preview should be generated for the result.

[JsonPropertyName("generatePreview")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool? GeneratePreview { get; set; }

Property Value

bool?

ObjectGroup

Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object.

[JsonPropertyName("objectGroup")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string? ObjectGroup { get; set; }

Property Value

string

ObjectId

Identifier of the object to call function on. Either objectId or executionContextId should be specified.

[JsonPropertyName("objectId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string? ObjectId { get; set; }

Property Value

string

ReturnByValue

Whether the result is expected to be a JSON object which should be sent by value. Can be overriden by serializationOptions.

[JsonPropertyName("returnByValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool? ReturnByValue { get; set; }

Property Value

bool?

SerializationOptions

Specifies the result serialization. If provided, overrides generatePreview and returnByValue.

[JsonPropertyName("serializationOptions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public SerializationOptions? SerializationOptions { get; set; }

Property Value

SerializationOptions

Silent

In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.

[JsonPropertyName("silent")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool? Silent { get; set; }

Property Value

bool?

ThrowOnSideEffect

Whether to throw an exception if side effect cannot be ruled out during evaluation.

[JsonPropertyName("throwOnSideEffect")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool? ThrowOnSideEffect { get; set; }

Property Value

bool?

UniqueContextId

An alternative way to specify the execution context to call function on. Compared to contextId that may be reused across processes, this is guaranteed to be system-unique, so it can be used to prevent accidental function call in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with executionContextId.

[JsonPropertyName("uniqueContextId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string? UniqueContextId { get; set; }

Property Value

string

UserGesture

Whether execution should be treated as initiated by user in the UI.

[JsonPropertyName("userGesture")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool? UserGesture { get; set; }

Property Value

bool?