Class
Actions

Generic action support for all browser types.

Definition

Namespace:ArtOfTest.WebAii.Core

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public abstract class Actions

Inheritance: objectActions

Derived Classes: AspNetHostActionsFireFoxActionsInternetExplorerActionsSafariActions

Properties

Browser

Gets the Browser object associated with this instance of the actions object.

Declaration

cs-api-definition
protected Browser Browser { get; }

Property Value

Browser

WaitCheckInterval

The Settings.WaitCheckInterval value.

Declaration

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

Property Value

int

Methods

AnnotateElement(Element, string)

Visually annotates an element on the browser surface during playback.

Declaration

cs-api-definition
public virtual void AnnotateElement(Element targetElement, string message)

Parameters

targetElement

Element

The target element to annotate.

message

string

The message to show in the annotation.

AnnotateMessage(string)

Visually annotate a message on the browser surface.

Declaration

cs-api-definition
public virtual void AnnotateMessage(string message)

Parameters

message

string

The message.

Check(Element, bool)

Sets the checked state of a specified radio button or checkbox.

Declaration

cs-api-definition
public virtual void Check(Element targetElement, bool checkedState)

Parameters

targetElement

Element

The target element.

checkedState

bool

True to set the target to checked, False to set it to unchecked.

CheckConsoleForJsErrors()

Checks the console of the current page for JavaScript errors

Declaration

cs-api-definition
public virtual List<JavascriptConsoleError> CheckConsoleForJsErrors()

Returns

List<JavascriptConsoleError>

A list of JavaScript console errors

Click(Element)

Perform a click on the target element.

Declaration

cs-api-definition
public virtual void Click(Element targetElement)

Parameters

targetElement

Element

The target element.

DoSelectDropDown(Element, string)

Performs the select drop down action.

Declaration

cs-api-definition
protected virtual void DoSelectDropDown(Element targetElement, string data)

Parameters

targetElement

Element

The target element.

data

string

The data to pass to the browser that provides information on how to do the select.

EnableResponsiveWebMode(bool)

Enable or disable responsive web mode.

Declaration

cs-api-definition
public virtual void EnableResponsiveWebMode(bool enable)

Parameters

enable

bool

True to enable responsive mode, false to diable.

GetComputedStyle(Element, string)

Get the computed style of this element.

Declaration

cs-api-definition
public abstract string GetComputedStyle(Element targetElement, string style)

Parameters

targetElement

Element

The target element.

style

string

The style to get (Visibility, display, etc.).

Returns

string

The string value of the style.

InvokeEvent(Element, ScriptEventType)

Invoke an event on the target element.

Declaration

cs-api-definition
public virtual void InvokeEvent(Element targetElement, ScriptEventType eventType)

Parameters

targetElement

Element

The target element.

eventType

ScriptEventType

Event type.

InvokeScript(string)

Invokes a javascript function. This function performs a javascript eval() on the callString and returns the result of that call as a string (if any).

Declaration

cs-api-definition
public virtual string InvokeScript(string script)

Parameters

script

string

The call/script to invoke.

Returns

string

The script result cast to string.

Example

string retValue = InvokeScript("myfunctioncall('hi', myvar);");

InvokeScript<T>(string)

Invokes a javascript function and then uses the System.Web.Extensions.Serialization.JavaScriptSeralizer to deserialize the returned JSON string from the function call to the object type T

Declaration

cs-api-definition
public virtual T InvokeScript<T>(string script)

Parameters

script

string

The call/script to invoke.

Returns

T

The script result as generic T type object.

Example

string retValue = InvokeScript("myfunctioncall(""hi"",myvar);");

OpenPdfForValidation(string)

Opens a PDF file for validaion.

Declaration

cs-api-definition
public void OpenPdfForValidation(string filePath)

Parameters

filePath

string

Path to the pdf file.

ScrollToVisible(Element)

Ensures that an item is visible in the browser. Scrolls it into view. Uses the ElementTopAtWindowTop.

Declaration

cs-api-definition
public virtual void ScrollToVisible(Element targetElement)

Parameters

targetElement

Element

The target element.

ScrollToVisible(Element, ScrollToVisibleType)

Ensures that an item is visible in the browser. Scrolls it into view.

Declaration

cs-api-definition
public virtual void ScrollToVisible(Element targetElement, ScrollToVisibleType scrollType)

Parameters

targetElement

Element

The target element.

scrollType

ScrollToVisibleType

The scrolling into view type (ElementTopAtWindowTop or ElementBottomAtWindowBottom).

ScrollToVisible(Element, ScrollToVisibleType, Rectangle)

Ensures that a specified portion of an element is visible in the browser. Scrolls the whole element into view if possible, otherwise as much of the specified portion as possible.

Declaration

cs-api-definition
public virtual void ScrollToVisible(Element element, ScrollToVisibleType scrollType, Rectangle rectangle)

Parameters

element

Element

The target element

scrollType

ScrollToVisibleType

Whether to align the element or portion with the top of the browser window or the bottom (ElementBottomAtWindowBottom or ElementTopAtWindowTop).

rectangle

Rectangle

The portion of the element which we are ensuring the visibility of.

SelectDropDown(Element, int)

Selects a drop down item from the drop down list by its index.

Declaration

cs-api-definition
public virtual void SelectDropDown(Element targetElement, int itemIndex)

Parameters

targetElement

Element

The target element.

itemIndex

int

The selected item index.

SelectDropDown(Element, string)

Selects a drop down item from the drop down list using the item's text.

Declaration

cs-api-definition
public virtual void SelectDropDown(Element targetElement, string itemText)

Parameters

targetElement

Element

The target element.

itemText

string

The text of the item to select.

Remarks

This function performs a case-insensitive search for the itemText in the list of the drop down items.

SelectDropDown(Element, string, bool)

Selects a drop down item from the drop down list using the item's text or the items option value (if useItemValue = true).

Declaration

cs-api-definition
public virtual void SelectDropDown(Element targetElement, string text, bool useValue)

Parameters

targetElement

Element

The target element.

text

string

The text of the item to select.

useValue

bool

If true, the text is the value of the item not it's textual representation.

Remarks

This function performs a case-insensitive search for the itemText in the list of the drop down items.

SetText(Control, string)

Set the text of an input or content editable control.

Declaration

cs-api-definition
public virtual void SetText(Control targetControl, string text)

Parameters

targetControl

Control

The target control (htmlControl for example).

text

string

The text to set

SetText(Element, string)

Set the text of a textbox or textarea.

Declaration

cs-api-definition
public virtual void SetText(Element targetElement, string text)

Parameters

targetElement

Element

The target element.

text

string

The text to set

ValidateTargetElement(Element)

Validates the target element.

Declaration

cs-api-definition
protected virtual void ValidateTargetElement(Element targetElement)

Parameters

targetElement

Element

The target element to validate.

Extension Methods