Mobile testing with Appium
This page provides step-by-step instructions for setting up Appium to enable iOS mobile device testing through Provar.
You will need the following:
- An iPad or iPhone (referred to as iPad below) with iOS 10 or later
- A MacBook or iMac (referred to as MacBook below) with:
- at least 4GB memory
- MacOs High Sierra or later installed*
- Xcode 9 or later installed on the MacBook*
- Patched version of Appium Desktop 1.6.2 or later installed on the MacBook
- Developer signed build of the application’s .ipa file for Native or Hybrid app testing**
*Earlier versions may work, but have not been tested. ** Provar can assist in providing appropriately signed .ipa files on request.
Open the App Store application on the MacBook (not iPad). Search for and install (or update) XCode version 9 or later.
Installing Appium Desktop
- On the MacBook, download Appium Desktop from here. This is the standard Appium Desktop 1.6.2 distribution with a patch for a know bug.
- Unzip the file and move it into your Applications folder.
- Open the Appium application and then close it.
- Open a terminal window and execute the following commands (it will ask for your password):
sudo chmod -R 777 /Applications/Appium.app cd /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
Getting iPad device ID and installing application
Plug the iPad into the MacBook via a USB lead.
Then launch XCode on the MacBook and open the Devices and Simulators window (main menu > Window > Devices and Simulators)
Locate the iPad under the Devices tab and make a note of its “identifier” by right-clicking it, choosing Copy and then pasting somewhere:
In the same window, click the + button beneath INSTALLED APPS and choose the .ipa file for the application from the file dialog (scroll down for larger screenshots):
Wait while the application is installed on the device and appears in the INSTALLED APPS list:
Then take a note of the newly installed application’s Identifier.
Setting up Web Driver Agent signing
Appium automatically builds and installs the WebDriverAgent app on your iPad. This needs to be signed with your Apple developer account (or the one supplied by Provar Support) before you can create or run tests for each device.
First Navigate to the following folder on your MacBook (using Finder):
Note: You can press CMD+Shift+G inside Finder to open the “Go to the folder” dialog and paste the above value.
Then double-click on the “WebDriverAgent.xcodeproj” file. This will open in XCode.
In XCode, select the iPad in the dropdown towards the left of the toolbar:
Choose WebDriverAgent in the Project Navigator on the left and then choose WebDriverAgentLib under the TARGETS:
Check the “Automatically manage signing” checkbox, accept the dialog and then click on “Add Account…”:
Sign-in with your Apple developer account or the credentials supplied to you by Provar Support:
Close the resulting Account details page:
Choose the newly added account in the Team dropdown:
Choose the remaining entries under the TARGETS list (WebDriverAgentRunner, UnitTests, etc.) and choose the same account in the Team dropdown for each one:
You can leave XCode running and proceed to the next steps.
Installing Appium Prerequisites
On the MacBook, open a Terminal window and run the following commands.
To install brew:
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
For XCode selection:
sudo xcode-select –reset
sudo xcode-select –switch /Applications/Xcode.app
To install libimobiledevice:
brew install –HEAD libimobiledevice
To install node/npm:
Download and install node.js from here: https://nodejs.org/en/download/
To install ios-deploy:
sudo npm install -g ios-deploy –unsafe-perm=true
To install Carthage:
brew install carthage
To install ios-webkit-debug-proxy:
brew unlink ios-webkit-debug-proxy
brew install ios-webkit-debug-proxy
brew link ios-webkit-debug-proxy
Enabling the Web Inspector on the iPad
On the iPad, launch the Settings app and choose Safari on the left. Scroll to the bottom on the right and choose Advanced. Then enable the Web Inspector setting:
Testing for 1 iPad
Start Appium from LaunchPad.
ServiceMax FSA mobile testing
If you have completed these steps as a part of the setup for ServiceMax FSA Mobile Testing, you can now proceed to the ServiceMax-specific setup steps as described on the ServiceMax FSA Mobile Testing page.
This section lists known installation issues with Appium and provides steps to fix them.
Failed to install FSA App on iPad
Symptom: Get installation failure then trying to install the ServiceMax .ipa file via the Devices and Simulators window in XCode.
Cause 1: Device not Provisioned
Apple requires that your iPad’s device ID is added to the .ipa file’s provisioning profile. Please contact Provar support to confirm that your device is listed.
Cause 2: Application is already installed
If you already have ServiceMax installed on your iPad, then uninstall it and then try again.
Install of ios-deploy fails
/bin/sh -c /usr/local/lib/node_modules/ios-deploy/build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D981F59D20100F954DB.sh cp: /System/Library/PrivateFrameworks/MobileDevice.framework/XPCServices: No such file or directory ** BUILD FAILED **
See the detailed steps posted by raydrogers here: https://github.com/ios-control/ios-deploy/issues/346.
Could not connect to lockdownd. Exiting.: Permission denied
The above message appears in the Appium log files
Run the following commands from a terminal window:
chmod +x /var/db/lockdown brew update brew upgrade ios-webkit-debug-proxy
Running Salesforce mobile tests
Once Appium server setup is complete, you can run Provar mobile tests in Run or Debug mode.
Before starting execution, make sure the Appium Server is up and running:
Make sure the Appium Server details are configured in Provar under the Browser Providers section:
Before clicking ‘Run’ or ‘Debug’, this Web Browser should be selected in the Web Browser dropdown in the top-right corner of Provar Desktop:
It should display as follows:
Below is an example test running:
And in Test Runner:
- General information
- Licensing Provar
- Provar trial guide and extensions
- Using Provar
- API testing
- Behavior-driven development
- Creating and importing projects
- Creating test cases
- Debugging tests
- Defining a namespace prefix on a connection
- Defining proxy settings
- Environment management
- Exporting test cases into a PDF
- Exporting test projects
- Managing test steps
- Namespace org testing
- Provar desktop
- Provar Test Builder
- Refresh and Recompile
- Reload Org Cache
- Running tests
- Searching Provar with find usages
- Secrets management and encryption
- Setup and teardown test cases
- Tags and Service Level Agreements (SLAs)
- Test cycles
- Test plans
- Testing browser options
- Tooltip testing
- Using the Test Palette
- Test Palette introduction
- Control test steps
- List compare
- Read test step
- String test steps
- UI Test Steps
- Using custom APIs
- Callable tests
- Data-driven testing
- Page objects
- Applications testing
- Database testing
- Document testing
- Email testing
- Mobile testing
- OrchestraCMS Testing
- Salesforce CPQ testing
- ServiceMax testing
- Skuid testing
- Vlocity testing
- Webservices testing
- Introduction to test scheduling
- Apache Ant
- Configuration for sending emails via the Provar Command Line Interface (CLI)
- Continuous integration
- Azure DevOps
- Running a Provar CI task in Azure DevOps
- Configuring the Provar secrets password in Microsoft Azure Pipelines
- Parallel execution in Microsoft Azure Pipelines using multiple build.xml files
- Parallel execution in Microsoft Azure Pipelines using targets
- Parallel execution in Microsoft Azure Pipelines using Test Plans
- Bitbucket Pipelines
- Circle CI
- GitLab CI
- Travis CI
- Parallel Execution
- Running Provar on Linux
- Salesforce DX
- Team foundation server
- Version control
- Zephyr Cloud and Server (Beta)
- Salesforce testing
- Adding a Salesforce connection
- Assert Page Error Messages on Add/Edit Product
- Internationalization support
- List and table testing
- Salesforce Release Updates
- Salesforce Lightning Testing
- Salesforce Lightning Web Component (LWC) locator support
- Service Cloud console testing
- Visualforce Testing
- Testing best practices
- Configurations and permissions
- Error messages
- Licensing, installation and firewalls
- Test Builder and test cases
- Release notes