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 nvmAdd 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_completionNext, 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-classifierStart Appium Server
appiumStart Test.ai Classifier Server
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.
Finally, execute the test case. If everything executes as expected:
The Photos app will launch on an iOS simulator.
The
Albumsicon will be tapped using a standard Appium selector.The
Searchicon will be tapped using AI-based selection via Test.ai's classifier.
Last updated
Was this helpful?