Class
Wait

Provide wait functionality for an Element object.

Definition

Namespace:ArtOfTest.WebAii.Synchronization

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class Wait

Inheritance: objectWait

Derived Classes: HtmlWait

Properties

Timeout

Gets/Sets the timeout for all Wait.Forxx methods. Default=Settings.ExecuteCommandTimeout

Declaration

cs-api-definition
public int Timeout { get; set; }

Property Value

int

Methods

ForAttributes(int, params string[])

Wait for a set of attributes on this element.

Declaration

cs-api-definition
public void ForAttributes(int timeout, params string[] attributesNameValuePairs)

Parameters

timeout

int

Wait timeout in milliseconds.

attributesNameValuePairs

string[]

The attribute name/value pairs

Example

Wait.ForAttribute("src=~foo.png","foo=bar")

ForAttributes(params string[])

Wait for a set of attributes on this element. (Timeout = Wait.Timeout)

Declaration

cs-api-definition
public void ForAttributes(params string[] attributesNameValuePairs)

Parameters

attributesNameValuePairs

string[]

The attributes name/value pairs

Example

Wait.ForAttribute("src=~foo.png","foo=bar")

ForAttributesNot(int, params string[])

Wait for a set of attributes to no longer be true.

Declaration

cs-api-definition
public void ForAttributesNot(int timeout, params string[] attributeNameValuePairs)

Parameters

timeout

int

Wait timeout in milliseconds.

attributeNameValuePairs

string[]

The attributes name/value pairs

ForAttributesNot(params string[])

Wait for a set of attributes to no longer be true. (Timeout = Wait.Timeout)

Declaration

cs-api-definition
public void ForAttributesNot(params string[] attributeNameValuePairs)

Parameters

attributeNameValuePairs

string[]

The attributes name/value pairs

ForCondition(Func<Element, object, bool>, bool, object, int)

Wait for a custom condition on this element.

Declaration

cs-api-definition
public void ForCondition(Func<Element, object, bool> condition, bool invertCondition, object custom, int timeout)

Parameters

condition

Func<Element, object, bool>

The condition to wait for.

invertCondition

bool

True/False whether to invert the condition or not.

custom

object

Any custom data to pass to this condition.

timeout

int

The timeout to use.

ForCondition(Func<Element, object, bool>, bool, object, int, WaitResultType)

Declaration

cs-api-definition
public void ForCondition(Func<Element, object, bool> condition, bool invertCondition, object custom, int timeout, WaitResultType errorResultType)

Parameters

condition

Func<Element, object, bool>

invertCondition

bool

custom

object

timeout

int

errorResultType

WaitResultType

ForContent(FindContentType, string)

Wait for certain content of this element to be true. (Timeout = Wait.Timeout)

Declaration

cs-api-definition
public void ForContent(FindContentType type, string value)

Parameters

type

FindContentType

The content type to wait for.

value

string

The content values to wait for. Value can be (p:partialvalue,l:liternal,x:regex)

ForContent(FindContentType, string, int)

Wait for certain content of this element to be true.

Declaration

cs-api-definition
public void ForContent(FindContentType type, string value, int timeout)

Parameters

type

FindContentType

The content type to wait for.

value

string

The content values to wait for. Value can be (p:partialvalue,l:liternal,x:regex)

timeout

int

The time out to wait for.

ForContentNot(FindContentType, string)

Wait for certain content of this element to no longer be true. (Timeout = Wait.Timeout)

Declaration

cs-api-definition
public void ForContentNot(FindContentType type, string value)

Parameters

type

FindContentType

The content type to wait for.

value

string

The content values to wait for. Value can be (p:partialvalue,l:liternal,x:regex)

ForContentNot(FindContentType, string, int)

Wait for certain content of this element to no longer be true.

Declaration

cs-api-definition
public void ForContentNot(FindContentType type, string value, int timeout)

Parameters

type

FindContentType

The content type to wait for.

value

string

The content values to wait for. Value can be (p:partialvalue,l:liternal,x:regex)

timeout

int

The time out to wait for.

ForExists()

Wait for this element to exist in the DOM.

Declaration

cs-api-definition
public void ForExists()

ForExists(int)

Wait for this element to exist in the DOM.

Declaration

cs-api-definition
public void ForExists(int timeout)

Parameters

timeout

int

Wait timeout.

ForExists(int, bool)

Wait for an element and decide on whether to refresh the element.

Declaration

cs-api-definition
protected virtual void ForExists(int timeout, bool refreshElement)

Parameters

timeout

int

refreshElement

bool

ForExistsNot()

Wait for this element not to exist in the DOM

Declaration

cs-api-definition
public void ForExistsNot()

ForExistsNot(int)

Wait for this element not to exist in the DOM.

Declaration

cs-api-definition
public void ForExistsNot(int timeout)

Parameters

timeout

int

Wait timeout