Class
HtmlControl

Base class for all HtmlControl's.

Definition

Constructors

HtmlControl()

Create a new emptry HtmlControl.

Declaration

cs-api-definition
public HtmlControl()

HtmlControl(Element)

Wrap the specified Element into a new HtmlControl.

Declaration

cs-api-definition
public HtmlControl(Element e)

Parameters

e

Element

The base element.

Properties

Attributes

All attributes defined for this HtmlControl.

Declaration

cs-api-definition
public virtual ReadOnlyCollection<iAttribute> Attributes { get; }

Property Value

ReadOnlyCollection<iAttribute>

A ReadOnlyCollection<iAttribute> of the attributes defined for this HtmlControl.

ChildNodes

Get all the child element nodes of this HtmlControl.

Declaration

cs-api-definition
public ReadOnlyCollection<Element> ChildNodes { get; }

Property Value

ReadOnlyCollection<Element>

A ReadOnlyCollection of the child Element's of this HtmlControl.

ClientSideLocator

Gets the client-side locator for this HtmlControl. This property can be used to define a custom client side object that this HtmlControl maps to. GetValue/SetValue properties use that object to make their calls instead of the default one.

Declaration

cs-api-definition
public virtual string ClientSideLocator { get; }

Property Value

string

A string identifying the locator for this HtmlControl.

Example

(in ASP.NET) $find('myClientObject')

CssClass

This HtmlControl's CSS class name.

Declaration

cs-api-definition
public virtual string CssClass { get; }

Property Value

string

A string specifying this HtmlControl's CSS class name. An empty string if not present for this HtmlControl

Remarks

See also http://msdn.microsoft.com/en-us/library/ms533560(VS.85).aspx

Events

The list of events defined on this HtmlControl

Declaration

cs-api-definition
public virtual NameValueCollection Events { get; }

Property Value

NameValueCollection

A NameValueCollection containing a list of events defined on this HtmlControl. An empty list is returned if there are no styles defined.

Find

Find property

Declaration

cs-api-definition
public virtual HtmlFind Find { get; }

Property Value

HtmlFind

GetElementByIdClientSideLocator

Returns the getElementByIdName script with ShadowDom support

Declaration

cs-api-definition
protected string GetElementByIdClientSideLocator { get; }

Property Value

string

GetElementByTagNameClientSideLocator

Returns the getElementByTagName script with ShadowDom support

Declaration

cs-api-definition
protected string GetElementByTagNameClientSideLocator { get; }

Property Value

string

ID

This HtmlControl's ID.

Declaration

cs-api-definition
public virtual string ID { get; }

Property Value

string

A string specifying this HtmlControls ID. An empty string if not present for this HtmlControl.

IsActiveElement

Gets whether this element has the keyboard focus

Declaration

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

Property Value

bool

IsEnabled

Gets / sets whether this control is enabled (not disabled)

Declaration

cs-api-definition
public bool IsEnabled { get; set; }

Property Value

bool

Remarks

Only applies to input controls

Mappings

Gets a mappings collection that stores customizable control specific mapping knowledge that can be later customized.

Declaration

cs-api-definition
public virtual MappingsCollection Mappings { get; }

Property Value

MappingsCollection

ScrollLeft

Gets / Sets the scrollLeft value of this HtmlControl.

Declaration

cs-api-definition
public virtual int ScrollLeft { get; set; }

Property Value

int

An int specifying the scrollLeft value.

ScrollTop

Gets / Sets the scrollTop value of this HtmlControl.

Declaration

cs-api-definition
public virtual int ScrollTop { get; set; }

Property Value

int

An int specifying the scrollTop value for this HtmlControl.

Styles

Styles collection set on this HtmlControl and persisted in the Html stream. This collection does not contain computed styles.

Declaration

cs-api-definition
public virtual NameValueCollection Styles { get; }

Property Value

NameValueCollection

A NameValueCollection containing a list of styles defined on this HtmlControl. An empty list is returned if there are no styles defined.

TagName

The tag name of this HtmlControl.

Declaration

cs-api-definition
public virtual string TagName { get; }

Property Value

string

A string specifying the tag identification of this HtmlControl.

Wait

Gets the HtmlWait object attached to this HtmlControl.

Declaration

cs-api-definition
public virtual HtmlWait Wait { get; }

Property Value

HtmlWait

An HtmlWait object. null if no HtmlWait object is attached to this HtmlControl.

Methods

AddEventListener(string, EventHandler<JavascriptEventArgs>)

Add an event handler to a Javascript event handler list on this HtmlControl.

Declaration

cs-api-definition
public virtual bool AddEventListener(string eventType, EventHandler<JavascriptEventArgs> listener)

Parameters

eventType

string

The event type to add the handler to.

listener

EventHandler<JavascriptEventArgs>

The event handler to add.

Returns

bool

True/False indicating whether or not the event handler was successfully added.

AsjQueryControl()

Convert this HtmlControl to jQueryControl.

Declaration

cs-api-definition
public jQueryControl AsjQueryControl()

Returns

jQueryControl

AssignElement(Element)

Attach the specified Element to this HtmlControl and initialize its internal properties.

Declaration

cs-api-definition
public override void AssignElement(Element e)

Parameters

e

Element

The base Element to attach to.

Overrides Control.AssignElement(Element)

CallMethod(string)

Call a client side Javascript method on this HtmlControl.

Declaration

cs-api-definition
public void CallMethod(string methodCall)

Parameters

methodCall

string

The method call.

CallMethod<T>(string)

Call a client side Javascript method on this HtmlControl and return type T.

Declaration

cs-api-definition
public virtual T CallMethod<T>(string methodCall)

Parameters

methodCall

string

The method call string.

Returns

T

The return value from the methoc call, if any

CallMethod<T>(string, T)

Call a client side Javascript method on this HtmlControl with return type of T and a default return value.

Declaration

cs-api-definition
public virtual T CallMethod<T>(string methodCall, T defaultValue)

Parameters

methodCall

string

The method call string.

defaultValue

T

A default value to use in case the conversion failed to the specified type and you want to return a custom default value other than default(T).

Returns

T

The return value of the call or the default value.

Capture()

Captures and returns a bitmap image of this HtmlControl.

Declaration

cs-api-definition
public virtual Bitmap Capture()

Returns

Bitmap

Bitmap of this HtmlControl.

Capture(string)

Captures and saves this HtmlControl's image to the WebAii log location as a Bitmap file.

Declaration

cs-api-definition
public virtual void Capture(string imageName)

Parameters

imageName

string

The image file name (without extension) to create and write to.

Capture(string, string)

Captures and saves this HtmlControl's image to the specified save path as the specified file name as a Bitmap file.

Declaration

cs-api-definition
public virtual void Capture(string savePath, string imageName)

Parameters

savePath

string

Directory path to write the file to.

imageName

string

The image file name (without extension) to create and write to.

Click()

Invoke a click on this HtmlControl.

Declaration

cs-api-definition
public virtual void Click()

Click(bool)

Invoke a click on this HtmlControl that will cause its browser window to close (this is common for html pop-ups).

Declaration

cs-api-definition
public virtual void Click(bool isClosing)

Parameters

isClosing

bool

If set, we won't wait for the browser to be ready. If not set it acts the same as HtmlControl.Click().

Download(bool, DownloadOption, string, int)

Clicks a control using the MouseClick or Click and handles the download dialogs sequence that is produced.

Declaration

cs-api-definition
public virtual void Download(bool clickUsingDesktopMouse, DownloadOption downloadOption, string saveLocation, int downloadTimeout)

Parameters

clickUsingDesktopMouse

bool

When set to True Desktop Mouse.Click will be used. Make sure the HtmlControl is visible in the browsers window first before using Desktop Mouse.Click. When set to False HtmlControl.Click will be used.

downloadOption

DownloadOption

The download option to use (Save or Cancel).

saveLocation

string

The save location on disk when the download option is set to Save.

downloadTimeout

int

The number of milliseconds to wait until all download dialogs are handled.

Exceptions

TimeoutException

Timed out waiting for the download dialogs to be handled.

DragTo(HtmlControl)

Drag this HtmlControl to the center on the destination HtmlControl.

Declaration

cs-api-definition
public virtual void DragTo(HtmlControl control)

Parameters

control

HtmlControl

The destination HtmlControl

DragTo(HtmlControl, OffsetReference, Point)

Drag to a destination HtmlControl with an offset of where within the destination HtmlControl to drag to.

Declaration

cs-api-definition
public virtual void DragTo(HtmlControl control, OffsetReference destinationOffsetReference, Point destinationOffset)

Parameters

control

HtmlControl

The destination HtmlControl.

destinationOffsetReference

OffsetReference

The destination offset reference.

destinationOffset

Point

The offset amount from destination reference. May be positive or negative.

DragTo(OffsetReference, Point, HtmlControl)

Drag this HtmlControl by specifying a reference point on the HtmlControl rectangle to start the drag from with an offset and drop on the destination HtmlControl center.

Declaration

cs-api-definition
public virtual void DragTo(OffsetReference sourceOffsetReference, Point sourceOffset, HtmlControl destination)

Parameters

sourceOffsetReference

OffsetReference

The source offset reference of the drag start.

sourceOffset

Point

The offset from the specified source reference. May be positive or negative.

destination

HtmlControl

The destination HtmlControl.

DragTo(OffsetReference, Point, HtmlControl, OffsetReference, Point)

Drag this HtmlControl by specifying a reference point on the HtmlControl rectangle to start the drag from and a reference point on the destination HtmlControl to specify the drop location.

Declaration

cs-api-definition
public virtual void DragTo(OffsetReference sourceOffsetReference, Point sourceOffset, HtmlControl destination, OffsetReference destinationOffsetReference, Point destinationOffset)

Parameters

sourceOffsetReference

OffsetReference

The source offset reference of the drag start.

sourceOffset

Point

The offset from the specified spirce reference. May be positive or negative.

destination

HtmlControl

The destination HtmlControl.

destinationOffsetReference

OffsetReference

The destination offset reference of the drop.

destinationOffset

Point

The offset from the specified destination reference. May be positive or negative.

DragTo(OffsetReference, Point, int, int)

Drag this HtmlControl from a source offset to an X/Y offset from the source.

Declaration

cs-api-definition
public virtual void DragTo(OffsetReference sourceOffsetReference, Point sourceOffset, int destinationOffsetX, int destinationOffsetY)

Parameters

sourceOffsetReference

OffsetReference

The source offset reference.

sourceOffset

Point

The source offset.

destinationOffsetX

int

The destination X offset relative to the source.

destinationOffsetY

int

The destination Y offset relative to the source.

DragTo(OffsetReference, int, int, Rectangle, OffsetReference, int, int)

Drag this HtmlControl from a source offset to an X/Y offset from the source.

Declaration

cs-api-definition
public virtual void DragTo(OffsetReference sourceOffsetReference, int sourceOffsetX, int sourceOffsetY, Rectangle destinationRectangle, OffsetReference destinationOffsetReference, int destinationOffsetX, int destinationOffsetY)

Parameters

sourceOffsetReference

OffsetReference

The source offset reference.

sourceOffsetX

int

The X offset from the source. May be positive or negative.

sourceOffsetY

int

The Y offset from the source. May be positive or negative.

destinationRectangle

Rectangle

destinationOffsetReference

OffsetReference

The destination rectangle reference.

destinationOffsetX

int

The X offset from the destination.

destinationOffsetY

int

The Y offset from the destination.

DragTo(OffsetReference, int, int, bool, HtmlControl, OffsetReference, int, int, bool)

Drag this HtmlControl by specifying a reference point on the HtmlControl rectangle to start the drag from and a reference point on the destination HtmlControl to specify the drop location.

Declaration

cs-api-definition
public virtual void DragTo(OffsetReference sourceOffsetReference, int sourceOffsetX, int sourceOffsetY, bool sourcePixelDrag, HtmlControl destination, OffsetReference destinationOffsetReference, int destinationOffsetX, int destinationOffsetY, bool pixelDrop)

Parameters

sourceOffsetReference

OffsetReference

The source offset reference of the drag start.

sourceOffsetX

int

The offset X from the specified source reference. May be positive or negative.

sourceOffsetY

int

The offset Y from the specified source reference. May be positive or negative.

sourcePixelDrag

bool

If True, will use the sourceOffsetX and sourceOffsetY as the pixel drop point, if false will use sourceOffsetX and sourceOffsetY as a percentage for calculating the drop point.

destination

HtmlControl

The destination HtmlControl.

destinationOffsetReference

OffsetReference

The destination offset reference of the drop.

destinationOffsetX

int

The offset X from the specified destination reference. May be positive or negative.

destinationOffsetY

int

The offset Y from the specified destination reference. May be positive or negative.

pixelDrop

bool

If True, will use the windowOffsetX and windowOffsetY as the pixel drop point, if false will use windowOffsetX and windowOffsetY as a percentage for calculating the drop point.

DragTo(Point)

Drag this HtmlControl to an absolute screen coordinate point.

Declaration

cs-api-definition
public virtual void DragTo(Point absolutePoint)

Parameters

absolutePoint

Point

The absolute screen coordinate point.

DragTo(int, int)

Drag this HtmlControl to a relative X/Y offset.

Declaration

cs-api-definition
public virtual void DragTo(int offsetX, int offsetY)

Parameters

offsetX

int

The X offset. May be positive or negative.

offsetY

int

The Y offset. May be positive or negative.

DragToWindowLocation(OffsetReference, int, int, bool, OffsetReference, int, int, bool)

Drag this HtmlControl, using the browser window as the drop target

Declaration

cs-api-definition
public virtual void DragToWindowLocation(OffsetReference sourceOffsetReference, int sourceOffsetX, int sourceOffsetY, bool sourcePixelDrag, OffsetReference windowOffset, int windowOffsetX, int windowOffsetY, bool pixelDrop)

Parameters

sourceOffsetReference

OffsetReference

The source offset reference of the drag start.

sourceOffsetX

int

The offset X from the specified source reference. May be positive or negative.

sourceOffsetY

int

The offset Y from the specified source reference. May be positive or negative.

sourcePixelDrag

bool

If True, will use the sourceOffsetX and sourceOffsetY as the pixel drop point, if false will use sourceOffsetX and sourceOffsetY as a percentage for calculating the drop point.

windowOffset

OffsetReference

The destination offest reference of the drag destination.

windowOffsetX

int

The offset X from the specified destination reference. May be positive or negative.

windowOffsetY

int

The offset Y from the specified destination reference. May be positive or negative.

pixelDrop

bool

If True, will use the windowOffsetX and windowOffsetY as the pixel drop point, if false will use windowOffsetX and windowOffsetY as a percentage for calculating the drop point.

FindParentContainer<TContainerControl>()

Traverses the DOM tree upwards until it finds the container element desired.

Declaration

cs-api-definition
protected Element FindParentContainer<TContainerControl>() where TContainerControl : HtmlContainerControl, new()

Returns

Element

The container element or element null.

Focus()

Give this Html element focus.

Declaration

cs-api-definition
public virtual void Focus()

GetAttributeAsString(string)

Get an attribute of this element as a string

Declaration

cs-api-definition
protected string GetAttributeAsString(string attributeName)

Parameters

attributeName

string

The attribute name to get.

Returns

string

The value of the attribute or a string.empty if the attribute is not available.

GetComputedStyle(string)

Returns an HtmlStyle object that can be used to easily probe the style value. (i.e. convert unit styles to Int32 or color value to System.Drawing.Color)

Declaration

cs-api-definition
public virtual HtmlStyle GetComputedStyle(string style)

Parameters

style

string

The style to access. (e.g. backgroundColor, left, border)

Returns

HtmlStyle

The HtmlStyle object that defines this style.

GetComputedStyleValue(string)

Returns the computed value of the specified style. The computed style value represents the final computed value taking into account the CSS properties for this HtmlElement.

Declaration

cs-api-definition
public virtual string GetComputedStyleValue(string style)

Parameters

style

string

The style to access. (e.g. backgroundColor, left, border)

Returns

string

The string value of the requested computed style.

GetRectangle()

The absolute screen position and size of this HtmlControl.

Declaration

cs-api-definition
public virtual Rectangle GetRectangle()

Returns

Rectangle

A Rectangle identifying the coordinates of the upper left corner and the width and height of this HtmlControl.

GetStyle(string)

Returns a HtmlStyle object that can be used to easily probe the style value. (i.e. convert unit styles to Int32 or color value to System.Drawing.Color)

Declaration

cs-api-definition
public virtual HtmlStyle GetStyle(string style)

Parameters

style

string

A string specifying the style to access. (e.g. backgroundColor, border)

Returns

HtmlStyle

A HtmlStyle object that defines this style.

GetStyleValue(string)

Returns any style as if you are accessing the element.style object from JavaScript.

Declaration

cs-api-definition
public virtual string GetStyleValue(string style)

Parameters

style

string

A string specifying the style to access. (e.g. backgroundColor, border)

Returns

string

The string value of the requested style.

GetValue<T>(string)

Get a property value (e.g. control.border or control.style.backgroundColor).

Declaration

cs-api-definition
public virtual T GetValue<T>(string propertyName)

Parameters

propertyName

string

The property name.

Returns

T

The value of the property or default(T) if the value of the property cannot be retrieved or converted to type T.

Remarks

The property is retrieved by executing Javascript on the client side using the specified property name as the Javascript function.

Example

string s = myControl.GetValue<string>("style.backgroundColor")

GetValue<T>(string, T)

Get a property value (e.g. control.border or control.style.backgroundColor) and return the specified default value if the get fails for any reason.

Declaration

cs-api-definition
public virtual T GetValue<T>(string propertyName, T defaultValue)

Parameters

propertyName

string

The property name.

defaultValue

T

A default value to use in case the conversion failed to the specified type and you want to return a custom default value other than default(T).

Returns

T

The value of the property or defaultValue if the property value cannot be retrieved or converted.

Remarks

The property is retrieved by executing Javascript on the client side using the specified property name as the Javascript function.

Example

string s = myControl.GetValue<string>("style.backgroundColor", "White")

GetValue<T>(string, bool)

Get a property value (e.g. control.border or control.style.backgroundColor) with ability to specify wrappedJSObject's in Firefox.

Declaration

cs-api-definition
[Obsolete]
public virtual T GetValue<T>(string propertyName, bool isJsWrappedObject)

Parameters

propertyName

string

The property name.

isJsWrappedObject

bool

Only applies to Firefox browser. Set to true to indicate this HtmlControl is a wrappedJSObject.

Returns

T

The value of the property.

Remarks

The property is retrieved by executing Javascript on the client side using the specified property name as the Javascript function.

Example

string s = myControl.GetValue<string>("style.backgroundColor", true)

GetValue<T>(string, bool, T)

Get a property value (e.g. control.border or control.style.backgroundColor) with ability to specify wrappedJSObject's in Firefox and return the specified default value if the get fails for any reason.

Declaration

cs-api-definition
[Obsolete]
public virtual T GetValue<T>(string propertyName, bool isJsWrappedObject, T defaultValue)

Parameters

propertyName

string

The property name.

isJsWrappedObject

bool

Only applies to Firefox browser. Set to true to indicate this HtmlControl is a wrappedJSObject.

defaultValue

T

The return value, if the property has no value (is null or the empty string)

Returns

T

The value of the property.

Remarks

The property is retrieved by executing Javascript on the client side using the specified property name as the Javascript function.

Example

string s = myControl.GetValue<string>("style.backgroundColor", true, "White")

InitializeMappings(MappingsCollection)

Initialize the Mappings collection. This method is called when the Mappings collection is accessed for the first time. It is then cached

Declaration

cs-api-definition
public virtual void InitializeMappings(MappingsCollection mappings)

Parameters

mappings

MappingsCollection

The mappings collection to populate

InvokeEvent(ScriptEvent)

Invokes an event on this HtmlControl.

Declaration

cs-api-definition
public virtual void InvokeEvent(ScriptEvent eventObj)

Parameters

eventObj

ScriptEvent

An object representing the event to invoke

InvokeEvent(ScriptEvent, bool)

Invokes an event on this HtmlControl.

Declaration

cs-api-definition
public virtual void InvokeEvent(ScriptEvent eventObj, bool closesBrowser)

Parameters

eventObj

ScriptEvent

An object representing the event to invoke

closesBrowser

bool

If set, we won't wait for the browser to be ready. If not set it acts the same as HtmlControl.InvokeEvent(eventObj).

InvokeEvent(ScriptEventType)

Invokes an event on this HtmlControl.

Declaration

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

Parameters

eventType

ScriptEventType

The ScriptEventType to invoke.

InvokeEvent(ScriptEventType, bool)

Invokes an event on this HtmlControl.

Declaration

cs-api-definition
public virtual void InvokeEvent(ScriptEventType eventType, bool closesBrowser)

Parameters

eventType

ScriptEventType

The ScriptEventType to invoke.

closesBrowser

bool

If set, we won't wait for the browser to be ready. If not set it acts the same as HtmlControl.InvokeEvent(eventObj).

IsVisible()

Returns whether the html element is visible or not. Returns true only when computedStyle.display != 'none' && computedStyle.visibility != 'hidden'

Declaration

cs-api-definition
public virtual bool IsVisible()

Returns

bool

True/False indicating whether or not this HtmlControl is currently visible on the page.

MouseClick()

Uses the Desktop.Mouse object to move the mouse to this HtmlControl and click it.

Declaration

cs-api-definition
public virtual void MouseClick()

MouseClick(MouseClickType)

Uses the Desktop.Mouse object to move the mouse to the absolute center of this HtmlControl and simulate a left mouse click. Be sure this HtmlControl is visible in the browser window first. Call ScrollToVisible(ScrollToVisibleType) or ScrollToVisible(ScrollToVisibleType, Rectangle)first if the element could be currently outside of the browsers window.

Declaration

cs-api-definition
public virtual void MouseClick(MouseClickType clickType)

Parameters

clickType

MouseClickType

Mouse Click Type

MouseClick(MouseClickType, Point, OffsetReference)

Uses the Desktop.Mouse object to move the mouse to a point relative to this HtmlControl and simulate the specified mouse click. Be sure this HtmlControl is visible in the browser window first. Call ScrollToVisible(ScrollToVisibleType) or ScrollToVisible(ScrollToVisibleType, Rectangle)first if the element could be currently outside of the browsers window.

Declaration

cs-api-definition
public virtual void MouseClick(MouseClickType clickType, Point offset, OffsetReference reference)

Parameters

clickType

MouseClickType

One of the MouseClickType types.

offset

Point

A point relative to the reference specified to click. The x and/or y values may be negative.

reference

OffsetReference

Which point on the HtmlControl is used as the reference point.

MouseClick(MouseClickType, int, int)

Uses the Desktop.Mouse object to move the mouse to a point relative to this HtmlControl and simulate the specified mouse click. Be sure this HtmlControl is visible in the browser window first. Call ScrollToVisible(ScrollToVisibleType) or ScrollToVisible(ScrollToVisibleType, Rectangle)first if the element could be currently outside of the browsers window.

Declaration

cs-api-definition
public virtual void MouseClick(MouseClickType clickType, int x, int y)

Parameters

clickType

MouseClickType

One of the MouseClickType types

x

int

The X offset relative to the left edge of the control to click. May be negative.

y

int

The Y offset relative to the top side of the control to click. May be negative.

MouseClick(MouseClickType, int, int, OffsetReference)

Uses the Desktop.Mouse object to move the mouse to a point relative to this HtmlControl and simulate the specified mouse click. Be sure this HtmlControl is visible in the browser window first. Call ScrollToVisible(ScrollToVisibleType) or ScrollToVisible(ScrollToVisibleType, Rectangle)first if the element could be currently outside of the browsers window.

Declaration

cs-api-definition
public virtual void MouseClick(MouseClickType clickType, int Xoffset, int Yoffset, OffsetReference reference)

Parameters

clickType

MouseClickType

One of the MouseClickType types.

Xoffset

int

The X offset relative to the specified reference to click. May be negative.

Yoffset

int

The Y offset relative to the specified reference to click. May be negative.

reference

OffsetReference

Which point on the HtmlControl is used as the reference point.

MouseHover()

Uses the Desktop.Mouse object to Hover over this absolute center of this HtmlControl. Be sure this HtmlControl is visible in the browser window first. Call ScrollToVisible(ScrollToVisibleType) or ScrollToVisible(ScrollToVisibleType, Rectangle)first if the element could be currently outside of the browsers window.

Declaration

cs-api-definition
public virtual void MouseHover()

MouseHover(Point)

Uses the Desktop.Mouse object to Hover over a point relative to this HtmlControl. Be sure this HtmlControl is visible in the browser window first. Call ScrollToVisible(ScrollToVisibleType) or ScrollToVisible(ScrollToVisibleType, Rectangle)first if the element could be currently outside of the browsers window.

Declaration

cs-api-definition
public virtual void MouseHover(Point pointToHoverOver)

Parameters

pointToHoverOver

Point

Point relative to the upper left corner of this HtmlControl to hover. X and/or Y value may be negative.

MouseHover(int, int)

Uses the Desktop.Mouse object to Hover over a point relative to this HtmlControl. Be sure this HtmlControl is visible in the browser window first. Call ScrollToVisible(ScrollToVisibleType) or ScrollToVisible(ScrollToVisibleType, Rectangle)first if the element could be currently outside of the browsers window.

Declaration

cs-api-definition
public virtual void MouseHover(int x, int y)

Parameters

x

int

The X offset relative to the left edge of the control to hover over. May be negative.

y

int

The Y offset relative to the top edge of the control to hover over. May be negative.

MouseHover(int, int, OffsetReference)

Uses the Desktop.Mouse object to Hover over a point relative to this HtmlControl. Be sure this HtmlControl is visible in the browser window first. Call ScrollToVisible(ScrollToVisibleType) or ScrollToVisible(ScrollToVisibleType, Rectangle)first if the element could be currently outside of the browsers window.

Declaration

cs-api-definition
public virtual void MouseHover(int x, int y, OffsetReference reference)

Parameters

x

int

The X offset relative to the specified reference to hover over. May be negative.

y

int

The Y offset relative to the specified reference to hover over. May be negative.

reference

OffsetReference

Which point on the HtmlControl is used as the reference point.

Parent<TContainerControl>()

Return the parent HtmlContainerControl of the desired type that this HtmlControl is contained inside of. If a parent HtmlControl of the desired type is not found, will return null.

Declaration

cs-api-definition
public virtual TContainerControl Parent<TContainerControl>() where TContainerControl : HtmlContainerControl, new()

Returns

TContainerControl

The parent container HtmlControl or null if desired type is not found.

ParseResponseValue<T>(string, T)

Declaration

cs-api-definition
protected T ParseResponseValue<T>(string response, T defaultValue)

Parameters

response

string

defaultValue

T

Returns

T

RemoveEventListener(string, EventHandler<JavascriptEventArgs>)

Removes an event handler from a Javascript event handler list on this HtmlControl.

Declaration

cs-api-definition
public virtual void RemoveEventListener(string eventType, EventHandler<JavascriptEventArgs> listener)

Parameters

eventType

string

The event type to be remove the event handler from.

listener

EventHandler<JavascriptEventArgs>

The event handler to remove.

ScrollToVisible()

Scroll the browsers window to make this HtmlControl visible on the page. This will method uses the ScrollToVisibleType.ElementTopAtWindowTop

Declaration

cs-api-definition
public virtual void ScrollToVisible()

ScrollToVisible(ScrollToVisibleType)

Scroll the browsers window to make this HtmlControl visible on the page.

Declaration

cs-api-definition
public virtual void ScrollToVisible(ScrollToVisibleType scrollToVisibleType)

Parameters

scrollToVisibleType

ScrollToVisibleType

How the HtmlControl should be aligned on the page

ScrollToVisible(ScrollToVisibleType, Rectangle)

Scroll the browsers window so that the specified rectangle within this HtmlControl is visible on the page.

Declaration

cs-api-definition
public virtual void ScrollToVisible(ScrollToVisibleType scrollToVisibleType, Rectangle rectangle)

Parameters

scrollToVisibleType

ScrollToVisibleType

How the HtmlControl should be aligned on the page.

rectangle

Rectangle

The rectangular portion of the HtmlControl that we want to make sure is visible on the page.

SetValue<T>(string, T)

Set a property value. (e.g. control.border = 2 or control.style.backgroundColor = "red")

Declaration

cs-api-definition
public virtual void SetValue<T>(string propertyName, T value)

Parameters

propertyName

string

The property name.

value

T

The value to set.

Example

myControl.SetValue$lt;string>("style.backgroundColor","red")

SetValue<T>(string, T, bool)

Set a property value. (e.g. control.border = 2 or control.style.backgroundColor = "red") myControl.SetValue<string>("style.backgroundColor","red")

Declaration

cs-api-definition
public virtual void SetValue<T>(string propertyName, T value, bool isJsWrappedObject)

Parameters

propertyName

string

The property name.

value

T

The value to set.

isJsWrappedObject

bool

Whether the property is a JsWrappedObject. Specific to Firefox.

Example

myControl.SetValue<string>("style.backgroundColor","red")

ToString()

Builds and returns a string representation of this element.

Declaration

cs-api-definition
public override string ToString()

Returns

string

A string representation of this element.

Overrides object.ToString()

ValidateControl()

Validate a HtmlControl using its LocatorExpression.

Declaration

cs-api-definition
protected bool ValidateControl()

Returns

bool

true of the control validated successfully. Otherwise false.

Exceptions

ArgumentException

Thrown when the control does not match its FindExpression.

Remarks

ValidateControl uses LocatorExpression if both LocatorExpression and Locator are defined, and uses Locator only if LocatorExpression is not defined.

ValidateTag(string)

Validate a tag name

Declaration

cs-api-definition
protected bool ValidateTag(string tagName)

Parameters

tagName

string

The tagName to verify.

Returns

bool

Extension Methods

In this article
DefinitionConstructorsHtmlControl()HtmlControl(Element)PropertiesAttributesChildNodesClientSideLocatorCssClassEventsFindGetElementByIdClientSideLocatorGetElementByTagNameClientSideLocatorIDIsActiveElementIsEnabledMappingsScrollLeftScrollTopStylesTagNameWaitMethodsAddEventListener(string, EventHandler<JavascriptEventArgs>)AsjQueryControl()AssignElement(Element)CallMethod(string)CallMethod<T>(string)CallMethod<T>(string, T)Capture()Capture(string)Capture(string, string)Click()Click(bool)Download(bool, DownloadOption, string, int)DragTo(HtmlControl)DragTo(HtmlControl, OffsetReference, Point)DragTo(OffsetReference, Point, HtmlControl)DragTo(OffsetReference, Point, HtmlControl, OffsetReference, Point)DragTo(OffsetReference, Point, int, int)DragTo(OffsetReference, int, int, Rectangle, OffsetReference, int, int)DragTo(OffsetReference, int, int, bool, HtmlControl, OffsetReference, int, int, bool)DragTo(Point)DragTo(int, int)DragToWindowLocation(OffsetReference, int, int, bool, OffsetReference, int, int, bool)FindParentContainer<TContainerControl>()Focus()GetAttributeAsString(string)GetComputedStyle(string)GetComputedStyleValue(string)GetRectangle()GetStyle(string)GetStyleValue(string)GetValue<T>(string)GetValue<T>(string, T)GetValue<T>(string, bool)GetValue<T>(string, bool, T)InitializeMappings(MappingsCollection)InvokeEvent(ScriptEvent)InvokeEvent(ScriptEvent, bool)InvokeEvent(ScriptEventType)InvokeEvent(ScriptEventType, bool)IsVisible()MouseClick()MouseClick(MouseClickType)MouseClick(MouseClickType, Point, OffsetReference)MouseClick(MouseClickType, int, int)MouseClick(MouseClickType, int, int, OffsetReference)MouseHover()MouseHover(Point)MouseHover(int, int)MouseHover(int, int, OffsetReference)Parent<TContainerControl>()ParseResponseValue<T>(string, T)RemoveEventListener(string, EventHandler<JavascriptEventArgs>)ScrollToVisible()ScrollToVisible(ScrollToVisibleType)ScrollToVisible(ScrollToVisibleType, Rectangle)SetValue<T>(string, T)SetValue<T>(string, T, bool)ToString()ValidateControl()ValidateTag(string)Extension Methods
Not finding the help you need?
Contact Support