XPath is a locator which is used to automate the web and mobile application. not only XPath we can use id, XPath name, text..etc.
But it doesn’t have any unique locator we go for XPath. To find XPath for the web applications we have so many plugins like Firebug, Fire path, Selector hub, and all. But for the mobile application only appium inspector was there, that also only for iOS.
Now we got one more tool to find XPath for both android and iOS applications.
Macaca Inspector
For Macaca inspector first thing you should be installed NodeJS
Then need to install Macaca Inspector with the following command
$ npm i app-inspector -g
Next, you have to connect your android/ios device(for android ADB setup has to be done) and run the below command to start Macaca inspector.
app-inspector -u <device uid>
The above command starts a local server and launch the appium inspector with a connected device view.
Navigate to the application screen and refresh the page to load the view on the browser. Click on the tree structure of the layout and you can find all the properties of element. Xpath also will be there..
