This test demonstrates how to automate a Windows desktop application using Appium, WinAppDriver, XPath, and OpenCV template image matching (similar to Sikuli).
Examples show:
- how to use WinAppDriver locators
- how to use Appium image locators (findElementByImage).
To run demo:
- start Appium Desktop
- in Appium Desktop, start server
- run AppiumCalculatorTest.java from your IDE (such as IntelliJ)
Setup:
- install node.js and npm
- install opencv4nodejs
- navigate to your local node_modules folder
- in git bash, run "which appium" to find out where it is (probably c:/Users/[your user]/AppData/Roaming/npm/npm_modules)
- in command prompt, run "npm install -g opencv4nodejs"
- if you encounter an error because the installer cannot run cmake, install cmake
- visit cmake.org/download/ and download the latest installer.
- close and reopen a command line window
- navigate again to node_modules folder and rerun command to install opencv4nodejs
- in command prompt, run "npm link opencv4nodejs"
- navigate to your local node_modules folder
- add support for the latest version of appium-java-client
- navigate to github.com/appium/java-client
- add jitpack and java-client dependencies using Maven or Gradle (depending on your project)
- change the "version" number to the most recent release
- run npm install -g appium-windows-driver
- activate Developer Mode on Windows 10
- (Settings / Updates & Security / For Developers / Developer Mode)
- download and install the most recent version of WinAppDriver
- download and install Appium Desktop