Installation
npm i -S appium-dom-utils
appium-dom-utils
A collection of util functions for writing Appium tests using DOM API.
const parseDomFromString getXPathSelector = ;const wdio = ; const client = await webdriverio;const xmlSourceString = await client;const dom = ;const domElement = dom;const xpath = ;const appiumElement = await client;await appiumElement;await client;
API
parseDomFromString(xml: String)
Returns a DOM object. Throws when the xml string is not formatted well. Currently tested with the return value of driver.getPageSource() for both Android (UiAutomator2) and iOS (UIAutomation) tests.
;;
getXPathSelector(el: Element)
Returns the xpath (string) for the element supplied. [Android UiAutomator2 tests].
;;
getClassChainSelector(el: Element)
Returns the class chain (string) for the element supplied. [iOS UIAutomation tests].
;;