ClassActions
Generic action support for all browser types.
Definition
Namespace:ArtOfTest.WebAii.Core
Assembly:ArtOfTest.WebAii.dll
Syntax:
public abstract class Actions
Inheritance: objectActions
Derived Classes:
Properties
Browser
Gets the Browser object associated with this instance of the actions object.
WaitCheckInterval
The Settings.WaitCheckInterval value.
Methods
AnnotateElement(Element, string)
Visually annotates an element on the browser surface during playback.
AnnotateMessage(string)
Visually annotate a message on the browser surface.
Declaration
public virtual void AnnotateMessage(string message)
Parameters
message
The message.
Check(Element, bool)
Sets the checked state of a specified radio button or checkbox.
CheckConsoleForJsErrors()
Checks the console of the current page for JavaScript errors
Declaration
public virtual List<JavascriptConsoleError> CheckConsoleForJsErrors()
Returns
A list of JavaScript console errors
Click(Element)
Perform a click on the target element.
Declaration
public virtual void Click(Element targetElement)
Parameters
targetElement
The target element.
DoSelectDropDown(Element, string)
Performs the select drop down action.
EnableResponsiveWebMode(bool)
Enable or disable responsive web mode.
Declaration
public virtual void EnableResponsiveWebMode(bool enable)
Parameters
enable
True to enable responsive mode, false to diable.
GetComputedStyle(Element, string)
Get the computed style of this element.
InvokeEvent(Element, ScriptEventType)
Invoke an event on the target element.
Declaration
public virtual void InvokeEvent(Element targetElement, ScriptEventType eventType)
Parameters
targetElement
The target element.
eventType
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).
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
public virtual T InvokeScript<T>(string script)
Parameters
script
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
public void OpenPdfForValidation(string filePath)
Parameters
filePath
Path to the pdf file.
ScrollToVisible(Element)
Ensures that an item is visible in the browser. Scrolls it into view. Uses the ElementTopAtWindowTop.
Declaration
public virtual void ScrollToVisible(Element targetElement)
Parameters
targetElement
The target element.
ScrollToVisible(Element, ScrollToVisibleType)
Ensures that an item is visible in the browser. Scrolls it into view.
Declaration
public virtual void ScrollToVisible(Element targetElement, ScrollToVisibleType scrollType)
Parameters
targetElement
The target element.
scrollType
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
public virtual void ScrollToVisible(Element element, ScrollToVisibleType scrollType, Rectangle rectangle)
Parameters
element
The target element
scrollType
Whether to align the element or portion with the top of the browser window or the bottom (ElementBottomAtWindowBottom or ElementTopAtWindowTop).
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.
SelectDropDown(Element, string)
Selects a drop down item from the drop down list using the item's text.
Declaration
public virtual void SelectDropDown(Element targetElement, string itemText)
Parameters
targetElement
The target element.
itemText
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
public virtual void SelectDropDown(Element targetElement, string text, bool useValue)
Parameters
targetElement
The target element.
text
The text of the item to select.
useValue
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.
SetText(Element, string)
Set the text of a textbox or textarea.
ValidateTargetElement(Element)
Validates the target element.
Declaration
protected virtual void ValidateTargetElement(Element targetElement)
Parameters
targetElement
The target element to validate.