Docs · API reference · Motus.Abstractions
IElementHandle Interface#
Represents a handle to a DOM element in the page. Prefer ILocator for most use cases.
public interface IElementHandle : Motus.Abstractions.IJSHandle, System.IAsyncDisposable
Implements IJSHandle, System.IAsyncDisposable
Methods#
BoundingBoxAsync(CancellationToken) Method#
Returns the bounding box of the element, or null if the element is not visible.
System.Threading.Tasks.Task<Motus.Abstractions.BoundingBox?> BoundingBoxAsync(System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));
Parameters#
ct System.Threading.CancellationToken
Cancellation token.
Returns#
System.Threading.Tasks.Task<BoundingBox>
The bounding box in CSS pixels.
GetAttributeAsync(string, CancellationToken) Method#
Gets the value of the specified attribute.
System.Threading.Tasks.Task<string?> GetAttributeAsync(string name, System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));
Parameters#
name System.String
The attribute name.
ct System.Threading.CancellationToken
Cancellation token.
Returns#
System.Threading.Tasks.Task<System.String>
The attribute value, or null if the attribute is not present.
TextContentAsync(CancellationToken) Method#
Returns the text content of the element.
System.Threading.Tasks.Task<string?> TextContentAsync(System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));
Parameters#
ct System.Threading.CancellationToken
Cancellation token.
Returns#
System.Threading.Tasks.Task<System.String>
The text content.