Class
BrowserRemoteClient

This class represents a client that the browser will create to talk to the automation infrastructure and respond to its requests.

Definition

Namespace:ArtOfTest.WebAii.Messaging.Process

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class BrowserRemoteClient : IBrowserRemotedClient

Inheritance: objectBrowserRemoteClient

Implements: IBrowserRemotedClient

Constructors

BrowserRemoteClient(Action<string, MemoryStream>)

Create a new BrowserRemoteClient object.

Declaration

cs-api-definition
public BrowserRemoteClient(Action<string, MemoryStream> customAssemblyHandler)

Parameters

customAssemblyHandler

Action<string, MemoryStream>

Properties

ClientId

Gets this client's unique id.

Declaration

cs-api-definition
public string ClientId { get; }

Property Value

string

Implements IBrowserRemotedClient.ClientId

IsConnected

Gets whether this client is connected or not to the Manager.

Declaration

cs-api-definition
public bool IsConnected { get; }

Property Value

bool

Implements IBrowserRemotedClient.IsConnected

Settings

Get the testcase execution settings as pushed by the server.

Declaration

cs-api-definition
public BrowserRemotedSettings Settings { get; }

Property Value

BrowserRemotedSettings

Implements IBrowserRemotedClient.Settings

Methods

Connect(BrowserType, string, IntPtr, bool, bool, int)

Connect this client to the Manager.

Declaration

cs-api-definition
public void Connect(BrowserType type, string version, IntPtr hwnd, bool isUILess, bool isDialog, int pid = 0)

Parameters

type

BrowserType

The type of the browser being connected.

version

string

The version of the browser being connected.

hwnd

IntPtr

The hwnd of the browser window being connected.

isUILess

bool

Whether this client is UI less or not.

isDialog

bool

Whether the browser client is a dialog (Used for IE modal/modeless dialogs).

pid

int

The process id of client application.

Disconnect()

Disconnect this client from Manager.

Declaration

cs-api-definition
public void Disconnect()

Implements IBrowserRemotedClient.Disconnect()

DispatchJavascriptEvent(JavascriptEventMessage)

Dispatches a Javascript event to WebAii

Declaration

cs-api-definition
public void DispatchJavascriptEvent(JavascriptEventMessage eventMessage)

Parameters

eventMessage

JavascriptEventMessage

Message containing information about the event

Implements IBrowserRemotedClient.DispatchJavascriptEvent(JavascriptEventMessage)

DoProvision()

Will attempt to provision this client, else will return false.

Declaration

cs-api-definition
public bool DoProvision()

Returns

bool

True/False whether the client is provisioned.

Implements IBrowserRemotedClient.DoProvision()

LogMessage(LogType, string)

Log a message to the centralized logging location.

Declaration

cs-api-definition
public void LogMessage(LogType type, string message)

Parameters

type

LogType

The log type to use.

message

string

The message

Implements IBrowserRemotedClient.LogMessage(LogType, string)

ProcessResponse(BrowserCommandEventArgs)

Process a response to the Manager.

Declaration

cs-api-definition
public void ProcessResponse(BrowserCommandEventArgs e)

Parameters

e

BrowserCommandEventArgs

The response.

Implements IBrowserRemotedClient.ProcessResponse(BrowserCommandEventArgs)

Events

BrowserRequest

Occurs when a browser request is issued. Browser clients subscribe to this event and execute the command in their respective browser. Once the requested command is complete, the client should call the ProcessResponse() method.

Declaration

cs-api-definition
public event EventHandler<BrowserCommandEventArgs> BrowserRequest

Event Value

EventHandler<BrowserCommandEventArgs>

Implements IBrowserRemotedClient.BrowserRequest

Remarks

Event handlers should block until the command is proceed. They should not return immediately. Otherwise we will deadlock.