Table of Contents

Interface IWebTestObject

Namespace
HP.LFT.SDK.Web
Assembly
HP.LFT.SDK.dll

A generic Web test object used only for implementation. Do not use to describe a concrete web test object.

public interface IWebTestObject : IWebDescriber, ITestObjectDescriber, ILocationInfoProvider, ISupportsNativeObject, IVisibleProvider
Inherited Members
Extension Methods

Properties

Attributes

Returns a copy of the collection of attributes that is attached to the element for instance 'id','class',etc.

IReadOnlyDictionary<string, string> Attributes { get; }

Property Value

IReadOnlyDictionary<string, string>

ClassName

The object's CSS class.

string ClassName { get; }

Property Value

string

Id

The object's HTML identifier.

string Id { get; }

Property Value

string

InnerHTML

The HTML code contained between the object's start and end tags.

string InnerHTML { get; }

Property Value

string

InnerText

The text contained between the object's start and end tags.

string InnerText { get; }

Property Value

string

Name

The object's name property.

string Name { get; }

Property Value

string

OuterHTML

The object's HTML code and its content.

string OuterHTML { get; }

Property Value

string

OuterText

The object's text.

string OuterText { get; }

Property Value

string

Styles

Returns the element's computed styles as a dictionary with the name of the style as the key.

IReadOnlyDictionary<string, string> Styles { get; }

Property Value

IReadOnlyDictionary<string, string>

Remarks

Returns an empty collection when run against Internet Explorer 8 or when the document mode of another Internet Explorer version is set to Internet 8 or earlier.

TagName

The object's HTML tag.

string TagName { get; }

Property Value

string

Title

The element's title attribute.

string Title { get; }

Property Value

string

Methods

Describe<TChild>(IDescription)

Describes a child test object.

TChild Describe<TChild>(IDescription description) where TChild : class, ITestObject

Parameters

description IDescription

The child test object description.

Returns

TChild

The requested child test object with its description.

Type Parameters

TChild

The child test object type.

Remarks

The current instance test object is the parent of the returned test object. This test object is searched for only when an operation on this test object is invoked. This means that if the test object is not found in the application, this command will still succeed. In this case, an exception is thrown only when an operation is invoked.

Describe<TChild>(CSSDescription)

Describes a child test object using the provided CSS selector.

TChild Describe<TChild>(CSSDescription cssSelector) where TChild : class, IWebElement

Parameters

cssSelector CSSDescription

The CSS selector query used to find the child test object.

Returns

TChild

The requested child test object with its description.

Type Parameters

TChild

The child test object type.

Remarks

The current instance test object is the parent of the returned test object. This test object is searched for only when an operation on this test object is invoked. This means that if the test object is not found in the application, this command will still succeed. In this case, an exception is thrown only when an operation is invoked.

Describe<TChild>(XPathDescription)

Describes a child test object using the provided XPath.

TChild Describe<TChild>(XPathDescription xpath) where TChild : class, IWebElement

Parameters

xpath XPathDescription

The XPath used to find the child test object.

Returns

TChild

The requested child test object with its description.

Type Parameters

TChild

The child test object type.

Remarks

The current instance test object is the parent of the returned test object. This test object is searched for only when an operation on this test object is invoked. This means that if the test object is not found in the application, this command will still succeed. In this case, an exception is thrown only when an operation is invoked.

GetAttribute(string)

Returns the value of a single attribute.

string GetAttribute(string attributeName)

Parameters

attributeName string

The attribute name for the value to retrieve.

Returns

string

The value of the specified attribute (null if the attribute does not exist).

GetComputedStyle(string)

Returns the value of a single style.

string GetComputedStyle(string styleProperty)

Parameters

styleProperty string

The style property for the value to retrieve.

Returns

string

The value of the specified style (null if the style property does not exist).