We’ve been seeing a lot of talk from users on Appium regarding the changes that have come out of the Appium 1.6.0 release. One of the biggest changes are the Appium inspector missing with Appium.
We’ve done a lot of research and we wanted to provide you the options that are available to work around this issue.
One of the tools that’s available that we use internally here on projects is Macaca.
Macaca was developed to run Appium with multiple selenium session in a single test. But there’s a very special tool within it that was updated to support the new instrumentation from Apple XCUITests.
The tool also has the ability to pull Xpath values for Android as well! #Winning
To install this tool you can follow the instructions on the repository in the link or you can follow them below!
**These instructions are under the assumption you have Appium installed locally already and Homebrew**
- Open up Terminal and run “ npm install macaca-cli -g “
- After install is complete, verify it was installed correctly, run “ macaca doctor ”
- If the error shows: “Command Line Tools: ios_webkit_debug_proxy is uninstalled”
- Run, ” brew install ios-webkit-debug-proxy “
- Then Run “ macaca doctor “
- Everything should be green
- When you have confirmed the installation was correct you should see
- Next, run ” npm install app-inspector -g ”
- After install is complete you should see that the words “BUILD SUCCESSFUL” in the logs.
- Launch a simulator and grab the DEVICE_ID or UUID of the simulator.
- To get the DEVICE_ID/UUID for iOS, run the following
- ” xcrun simctl list “
- Find the device name of the simulator which shows booted like below:
- To use an android device or simulator, run the following
- “adb devices”
- Copy the UUID and then run,” app-inspector -u YOUR-DEVICE-ID ” * Make sure simulator is booted first before running*
- When the process is finished, it will load a new window with the view hierarchy loaded and BRAVO! you now have a app inspector. We’re not done yet though!
- ** For iOS** Next we need to load the app we want to inspect to the device.
- You can launch the simulator from Xcode and deploy the app, *** If you deploy the app this way after starting the app inspector server you will have to kill the server and relaunch after the app has been deployed OR
- You can install it if you have a .app file already built locally
- Run ” xcrun simctl install YOUR-DEVICE-ID ~/PATH-TO-.APP/
- Launch the application you installed to simulator
- For Android you can load any application via adb
- ” adb install example.apk“
- For simulator ” adb install -s example.apk “
- Now you if you go back to the page that loaded the view hierarchy, hit refresh and the app view will load.
- If you click on a element in the view, it will highlight where that element corresponds to in the view like below:
OR You can select the element from the tree and it will highlight it on the view.
On the right hand side you will see that it will also include the Xpath
That’s it! If you look for a way to build up an ideal Appium test environment for yourself, download step-by-step instructions.
Now you can use the tool to view and identify elements in the view hierarchy.
Let’s us know in the comments of any other tools or if you have a different method we would love to hear it!
Learn all the basics about Appium, how to set it up and how to use it for mobile app testing.Download