Skip to content

WinEvents.Search

Avrigeanu Laurian edited this page Sep 5, 2022 · 3 revisions

GetWindow (Window)

This method will retrieve the Window by using the given XPath.

Mandatory Parameters Optional Parameters
string xPath int retries (default:15)
  double retryInterval (default 1)

Example:

var getWindow = WinEvents.Search.GetWindow("*[@Name='Chrome']");

GetWindows (List<Window>)

This method will retrieve the Windows by using the given XPath.

Mandatory Parameters Optional Parameters
string xPath int retries (default:15)
  double retryInterval (default 1)

Example:

var getWindows = WinEvents.Search.GetWindows("*[@Name='Chrome']");

FindElement(AutomationElement)

This method will search for an element inside of a given Window using the provided XPath.

Mandatory Parameters Optional Parameters
Window window int retries (default:15)
string xPath double retryInterval (default 1)

Example:

var getElement = WinEvents.Search.FindElement(windowElement, "//*[@Name='OkButton']");

FindElements(List<AutomationElement>)

This method will search for elements inside of a given Window using the provided XPath.

Mandatory Parameters Optional Parameters
Window window int retries (default:15)
string xPath double retryInterval (default 1)

Example:

var getElements = WinEvents.Search.FindElements(windowElement, "//*[@Name='OkButton']");

FindElementInElement (AutomationElement)

This method will search for an element inside of a given element using the provided XPath.

Mandatory Parameters Optional Parameters
AutomationElement element int retries (default:15)
string xPath double retryInterval (default 1)

Example:

var getElement = WinEvents.Search.FindElementInElement(windowElement, "//*[@Name='OkButton']");

FindElementsInElement (List<AutomationElement>)

This method will search for elements inside of a given element using the provided XPath.

Mandatory Parameters Optional Parameters
AutomationElement element int retries (default:15)
string xPath double retryInterval (default 1)

Example:

var getElements = WinEvents.Search.FindElementsInElement(windowElement, "//*[@Name='OkButton']");