How-to: AI Using Appium
In this demo, we will try using the Test.ai classifier plugin with Appium.
Install all Dependencies
This demo currently only supports macOS operating systems.
Open a terminal, and execute the following:
brew install pkg-config cairo pango libpng jpeg giflib
brew install nvm
Add the following to ~/.zshrc or your desired shell configuration file:
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
Next, execute the following:
nvm install v14.16.1
nvm use v14.16.1
npm install -g npm
npm install -g appium
npm install -g test-ai-classifier
Start Appium Server
appium
Start Test.ai Classifier Server
test-ai-classifier
Appium Pro Sample Project
Clone the repository located here.
Open the java
folder inside of your favorite Java IDE (IntelliJ recommended) and use the Gradle IDE features to install dependencies. IntelliJ does this automatically.
Open the Edition039_AI_For_Appium.java
file and replace the contents with the file below.
Next, look for the following line of code, and replace 13.4
with the correct iOS version for the iPhone 8
simulator installed on your machine. You may use idb list-targets
to find this information.
caps.setCapability("platformVersion", "13.4");
Finally, execute the test case. If everything executes as expected:
The Photos app will launch on an iOS simulator.
The
Albums
icon will be tapped using a standard Appium selector.The
Search
icon will be tapped using AI-based selection via Test.ai's classifier.
Last updated
Was this helpful?