Adding AI to Appium Step-by-Step guide for Android emulator
Posted on October 22, 2018
Applying artificial intelligence (AI) for testing has become better for Android, IOS and web automation. On October 18th, 2018, Test.ai partnered with Appium. Test.ai open sourced its AI classifier and Appium created a plugin for Appium that is available in this Git repository. In a nutshell, Test.ai has trained an AI classifier with thousands of images, which have also been open sourced and made available in Kaggle and with this model you can simplify the automation scripts an use descriptive names to locate buttons, images, text boxes, etc. in all of our clients with a keyword, instead of all those magic IDs, CSS, or XPaths. For example, we would be able locate the "cart" icon in the page no matter how it looks like since the AI classifier has learned how to recognize different "cart" icons. I have created a short a video on how to apply this concept on an Android, IOS and web clients testing.
brew install pkg-config cairo pango libpng jpeg giflib
vim ~/.bash_profile
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home"
PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$JAVA_HOME/bin
export PATH
source ~/.bash_profile
Install Android Studio - https://developer.android.com/studio/
npm install appium@1.9.2-beta.2
npm install -g mocha
cd /usr/local/lib/node_modules/appium/
npm install test-ai-classifier
adb install walmart.apk
npm install -g appium-doctor
appium-doctor --android
mocha --timeout 30000 test/test-android.js