C# Class TestAutomationEssentials.Selenium.BrowserElement

Represents a single DOM element in a browser
This class wraps Selenium's IWebElement to provide additional capabilities for logging, automatic waiting and more.
Inheritance: ElementsContainer, IWebElement, IWrapsElement
Afficher le fichier Open project: arnonax/TestEssentials Class Usage Examples

Private Properties

Свойство Type Description
BrowserElement System
CreateActionsSequence OpenQA.Selenium.Interactions.Actions
GetParentLocator OpenQA.Selenium.By
GetWebElement IWebElement
GetWebElement IWebElement
ISearchContext IWebElement
ISearchContext ReadOnlyCollection
IWebElement string
IWebElement void
IWebElement void
IsAvailable bool
IsReady bool
SafeGetDOMRoot IDOMRoot

Méthodes publiques

Méthode Description
BrowserElement ( ElementsContainer container, By by, Func selector, string description ) : System

Initializes a new instance of BrowserElement given its container, a 'By' filter a selector and description

BrowserElement ( ElementsContainer container, By by, string description ) : System

Initialized a new instance of BrowserElement given its container, a specific 'By' filter and description

Click ( ) : void
DoubleClick ( ) : void

Performs a double-click on the element

DragAndDrop ( BrowserElement target ) : void

Drags the current element onto the target element

GetAttribute ( string attributeName ) : string
GetParent ( string description ) : BrowserElement

Returns the immediate parent element containing the current element

Hover ( ) : void

Hovers the mouse over the element

WaitToDisappear ( int seconds = DefaultWaitTimeout ) : void

Waits for the current element to disappear. That is, either become invisible or completely removed from the DOM

Méthodes protégées

Méthode Description
Activate ( ) : void
BrowserElement ( BrowserElement otherElement ) : System

Copy constructor

BrowserElement ( BrowserElement otherElement, string description ) : System

Constructs a new instance of BrowserElement by copying its properties, except of its description from another element

GetSearchContext ( ) : ISearchContext

Private Methods

Méthode Description
BrowserElement ( IDOMRoot domRoot, Func getWebElement, string description ) : System
CreateActionsSequence ( ) : OpenQA.Selenium.Interactions.Actions
GetParentLocator ( ) : By
GetWebElement ( ) : IWebElement
GetWebElement ( ElementsContainer elementsContainer, By by, Func selector, string description ) : IWebElement
ISearchContext ( By by ) : IWebElement
ISearchContext ( By by ) : ReadOnlyCollection
IWebElement ( string propertyName ) : string
IWebElement ( ) : void
IWebElement ( string text ) : void
IsAvailable ( IWebElement el ) : bool
IsReady ( ) : bool
SafeGetDOMRoot ( ElementsContainer otherElement, string paramName ) : IDOMRoot

Method Details

Activate() protected méthode

protected Activate ( ) : void
Résultat void

BrowserElement() protected méthode

Copy constructor
protected BrowserElement ( BrowserElement otherElement ) : System
otherElement BrowserElement Other object from which to copy the properties into the new object
Résultat System

BrowserElement() protected méthode

Constructs a new instance of BrowserElement by copying its properties, except of its description from another element
is null
protected BrowserElement ( BrowserElement otherElement, string description ) : System
otherElement BrowserElement The existing element to copy its properties from
description string The new description to use for the new object
Résultat System

BrowserElement() public méthode

Initializes a new instance of BrowserElement given its container, a 'By' filter a selector and description
Any of the arguments is null
public BrowserElement ( ElementsContainer container, By by, Func selector, string description ) : System
container ElementsContainer The container that contains the relevant element. Typically this is a , , or a containing
by OpenQA.Selenium.By A filter mechanism used to filter the matching elements
selector Func A delegate that is used to select the sepecific element from the filtered elements
description string The description of the new element
Résultat System

BrowserElement() public méthode

Initialized a new instance of BrowserElement given its container, a specific 'By' filter and description
Any of the arguments is null
public BrowserElement ( ElementsContainer container, By by, string description ) : System
container ElementsContainer The container that contains the relevant element. Typically this is a , , or a containing
by OpenQA.Selenium.By A filter mechanism used to find the element. If multiple elements match the filter, the first one is used
description string The description of the new element
Résultat System

Click() public méthode

public Click ( ) : void
Résultat void

DoubleClick() public méthode

Performs a double-click on the element
public DoubleClick ( ) : void
Résultat void

DragAndDrop() public méthode

Drags the current element onto the target element
is null
public DragAndDrop ( BrowserElement target ) : void
target BrowserElement The target element to drop the current element onto
Résultat void

GetAttribute() public méthode

public GetAttribute ( string attributeName ) : string
attributeName string
Résultat string

GetParent() public méthode

Returns the immediate parent element containing the current element
public GetParent ( string description ) : BrowserElement
description string The description to give to the parent element
Résultat BrowserElement

GetSearchContext() protected méthode

protected GetSearchContext ( ) : ISearchContext
Résultat ISearchContext

Hover() public méthode

Hovers the mouse over the element
public Hover ( ) : void
Résultat void

WaitToDisappear() public méthode

Waits for the current element to disappear. That is, either become invisible or completely removed from the DOM
The current element hasn't been disappeared for the specified period
public WaitToDisappear ( int seconds = DefaultWaitTimeout ) : void
seconds int Timeout in seconds to wait for the element to disappear
Résultat void