With the introduction of appium server 2.x, we have to run the appium server either by code or as CLI command, we can’t use the appium desktop which in turn provides the appium inspector.
To overcome above issue, appium provided separate appium inspector tool.
There are 2 ways to get the appium inspector tool
- Web portal without installing.
- Desktop utility from github repo to install and use.
Refer to the releases section of this appium inspector github repo and download the latest release based on your operating system.
Appium-Inspector-linux-xxxx.xx.x.AppImage (to use in linux os)
Appium-Inspector-mac-xxxx.xx.x.dmg (to use in mac os)
Appium-Inspector-windows-xxxx.xx.x.exe (to use in windowsOS)
The functionalities are similar for the desktop utility and the web portal version.
Now the appium inspector ready, the 2nd step is to inspect the mobile app elements.
You can inspect the android / IOS application on a real device or simulators.
You can use appium inspector to install the mobile app, with a condition you should have the app path handy.
For IOS –
.ipa for real device
.app for ios simulators
.apk for android emulators
We will be taking saucelabs demo react app for both android and ios
download the apps from here – https://github.com/saucelabs/my-demo-app-rn/releases
We need to provide appium capabilities for android or ios devices and apps, so the inspector will pickup the app from specified device / simulators.
Chose 1st tab “Appium Server” for mobile devices attached to local machine, else chose proper service providers from “Select cloud providers” tab.
Appium app capabilities –
example – IOS app capabilities
{ "appium:platformVersion": "16.0", "appium:deviceName": "iPhone SE (3rd generation)", "appium:automationName": "XCUITest", "appium:platformName": "ios", "appium:app": "/filePath/MyRNDemoApp.app", "appium:noReset": true }
example – Android app capabilities
{ "appium:deviceName": "emulator-5554", "appium:automationName": "UiAutomator2", "appium:platformName": "android", "appium.appPackage": "com.saucelabs.mydemoapp.rn", "appium.appActivity": ".MainActivity" }
Note – all the capabilities should be prepended with appium:
If using appium:app to install during inspection, then it’s suggested to use appium:noReset so it won’t install again if installed.
If you have any updated app to install, then don’t use appium:noReset
If you want to inspect on preinstalled apps, then use below capability instead of appium:app
for android –
appium:appPackage
appium:appActivity
for ios –
appium:bundleId
To start the inspection, click on the “Start Session”
Note – you have to run appium server before “Start Session”
You should see the app screen mock on the inspector window.
Tap on any element on the mock up screen and see the locators on the right side panel as above.
Based on the locators available, you can use appium method to identify the elements and perform actions to test.
There are other features like validate locators, on screen tap, sendKeys on elements etc with in the appium inspectors are available, which you can watch from the above uploaded video.
2 Comments