A Beginner's Guide to AI and Testing
  • Welcome AI Testers!
  • TUTORIAL
    • Exercise: Object Detection
    • Exercise: Try Chopper Yourself
    • Exercise: Python Chopper
  • Demo: Build Your Own Chopper
  • Exercise: Build Your Own Agent
  • Demo: AGENT Exploration
  • Demo: AGENT Test Generation
  • SELF STUDY
    • How-to: Teachable Machine
    • How-to: Build Your Own Classifier
    • How-to: AI Using Appium
    • How-to: Template Matching
Powered by GitBook
On this page
  • Install all Dependencies
  • Start Appium Server
  • Start Test.ai Classifier Server
  • Appium Pro Sample Project

Was this helpful?

  1. SELF STUDY

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

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:

  1. The Photos app will launch on an iOS simulator.

  2. The Albums icon will be tapped using a standard Appium selector.

  3. The Search icon will be tapped using AI-based selection via Test.ai's classifier.

The test.ai classifier that is installed out of the box has been pre-trained. You may train your own classifier by following the next tutorial.

PreviousHow-to: Build Your Own ClassifierNextHow-to: Template Matching

Last updated 1 year ago

Was this helpful?

Clone the repository located .

here
3KB
edition039_ai_for_appium.java
Edition039_AI_For_Appium.java