Find-ElementFlex

Searches for an element matching a given locator value.

Powershell

Searches for an element matching the locator value. Returns: the first element matching the locator value.

Syntax

Find-ElementFlex [-sessionId ] -class []

Find-ElementFlex [-sessionId ] -xpath []

Find-ElementFlex [-sessionId ] -marked []

Parameters

name description
sessionId (Optional) The identifier of the session to route the command to.
xpath (xpath locator) The value for the xpath locator
class (class locator) The value for the class locator
marked (Marked locator) The value for the marked locator

Examples

Find-ElementFlex -marked "Login"
Find-ElementFlex -xpath "*[@marked='Login']"
Find-ElementFlex -class "UIView"

C#

Declaration

OpenQA.Selenium.Internal.IFindsByXPath::IWebElement FindElementByXPath(string xpath);

Arguments:

type name description
System.String xpath The XPath query to match.

Returns:

type description
OpenQA.Selenium.IWebElement The first IWebElement matching the criteria

Examples

driver.findElementByXPath(xPath);
driver.FindElementById(id);
driver.FindElementByClassName(className);
driver.FindElementByPredicateString(className);
driver.FindElementByClassChain(className);

Comments

FindElementByClassChain and FindElementByPredicateString are only supported on iOS

Last modified January 1, 0001