Can you find XPath for mobile apps? Now WE CAN !!
https://macacajs.com/

Can you find XPath for mobile apps? Now WE CAN !!

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 if doesn't have any unique locator we go for XPath. To find XPath for the web applications we have so many plugins like Firebug, Firepath 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 application.

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>


Once inspector get started you can view the all the mobile element properties with XPath.

Enjoy automating !! Enjoy Testing

after run og app-inspector -u c3bec4020603 got error: { Error: Command failed: C:\Program Files (x86)\Android SDK/platform-tools/adb - s c3bec4020603 forward tcp:9001 tcp:9001 'C:\Program' is not recognized as an internal or external command, operable program or batch file. at ChildProcess.exithandler (child_process.js:204:12) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:886:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) killed: false, code: 1, signal: null, cmd: 'C:\\Program Files (x86)\\Android SDK/platform-tools/adb -s c3bec4020603 forward tcp:9001 tcp:9001' } ^CTerminate batch job (Y/N)? y

回复

There are lots of other tools also to find elements of mobile apps, if we talk about iOS than Calabash is one of the powerful tool, we can easily find elements by applying queries.

回复
Dimpy Adhikary

Staff Quality Architect @Vonage| Ex: Quality Analyst @Thoughtworks | Test Automation Specialist | ML enthusiast| AWS Cloud Practitioner | Mentor | Blogger

8 年

I am getting the following error while running app-inspector -u <device uid> app-inspector:66:44 [master] pid:10312 Error: Cannot find module 'uiautomator-client' I tried installing uiautomator-client but getting following error: C:\Users\dimpy.adhikary\AppData\Roaming\npm\node_modules\uiautomator-client\scripts\build.js:177 throw e; ^ TypeError: Cannot read property 'replace' of undefined at spawn (C:\Users\dimpy.adhikary\AppData\Roaming\npm\node_modules\uiautomator-client\node_modules\win-spawn\index.js:7:22) at Promise (C:\Users\dimpy.adhikary\AppData\Roaming\npm\node_modules\uiautomator-client\scripts\build.js:143:24) at buildBootstrap (C:\Users\dimpy.adhikary\AppData\Roaming\npm\node_modules\uiautomator-client\scripts\build.js:142:10) at process._tickCallback (internal/process/next_tick.js:103:7) npm ERR! Windows_NT 10.0.10240 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "uiautomator-client" npm ERR! node v7.4.0 npm ERR! npm v4.0.5 npm ERR! code ELIFECYCLE npm ERR! [email protected] install: `node ./scripts/build.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script 'node ./scripts/build.js' Can you help me on this please, do I missed anything?

回复

要查看或添加评论,请登录

Dharmalingam Krishnan的更多文章

  • GraphQL- Alternative to Rest API

    GraphQL- Alternative to Rest API

    The Basics of GraphQL GraphQL provides a flexible and efficient approach to querying and manipulating data. It allows…

  • API Testing Course

    API Testing Course

    API Testing course from scratch to expert level using Postman tool. Sample API, you can use from the https://reqres.

    1 条评论
  • Do you want to become a mobile app automation tester?

    Do you want to become a mobile app automation tester?

    There are so many automation tools to automate web application and here is the list of tools to automate mobile…

    1 条评论

社区洞察

其他会员也浏览了