Class Response
Handles reponses from the browser
public class Response
- Inheritance
-
Response
- Inherited Members
Constructors
Response()
Initializes a new instance of the Response class
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
public Response()
Response(SessionId?)
Initializes a new instance of the Response class
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
public Response(SessionId? sessionId)
Parameters
sessionId
SessionIdSession ID in use
Response(string?, object?, WebDriverResult)
Initializes a new instance of the Response class
public Response(string? sessionId, object? value, WebDriverResult status)
Parameters
sessionId
stringThe Session ID in use, if any.
value
objectThe JSON payload of the response.
status
WebDriverResultThe WebDriver result status of the response.
Properties
SessionId
Gets or sets the session ID.
public string? SessionId { get; set; }
Property Value
Status
Gets or sets the status value of the response.
public WebDriverResult Status { get; set; }
Property Value
Value
Gets or sets the value from JSON.
public object? Value { get; set; }
Property Value
Methods
FromErrorJson(string)
Returns a new Response from a JSON-encoded string.
public static Response FromErrorJson(string value)
Parameters
Returns
Exceptions
- ArgumentNullException
If
value
is null.- JsonException
If
value
is not a valid JSON object.- WebDriverException
If the JSON dictionary is not in the expected state, per spec.
FromJson(string)
Returns a new Response from a JSON-encoded string.
public static Response FromJson(string value)
Parameters
Returns
Exceptions
- ArgumentNullException
If
value
is null.- JsonException
If
value
is not a valid JSON object.
ToJson()
Returns this object as a JSON-encoded string.
public string ToJson()
Returns
ToString()
Returns the object as a string.
public override string ToString()
Returns
- string
A string with the Session ID, status value, and the value from JSON.