Test-Element

Tests whether an element exist matching the given xpath

Powershell

Tests whether an element exist matching the given xpath Returns: $true or $false depending on the existens of the element.

Throws exception when the element is not found because there is a popup present.

Syntax

Test-Element [-sessionId ] [-xpath] [-ignoreVisibility ] []

Test-Element [-sessionId ] -using {ClassName | CssSelector | Id | Name | LinkText | PartialLinkText | TagName | XPath | PredicateString | ClassChain} -value [-ignoreVisibility ] []

Parameters

name description
sessionId (Optional) The identifier of the session to route the command to.
xpath The xpath for which to test the element.
using
value
ignoreVisibility (Optional) indicates whether non visible elements should be taken into account.

Examples

Test-Element -xpath "*[@marked='login']"