Integrating Arrow with Sikuli

What is Arrow

Arrow is a test automation framework that promotes test driven development (TDD). The framework was developed by Yahoo! and recently released as open source project on Github. For more information about Arrow you can visit the project site at: https://github.com/yahoo/arrow

What is Sikuli

Sikuli is an academic and research project at the MIT. It is an open source image based technology to automate testing graphical user interfaces. For more information about Sikuli please visit their web site at: http://sikuli.org

Installation on Linux

This article assumes that you have access to a Linux machine (In our case we will be using Ubuntu Linux flavor). If you do not have a physical Linux machine you can use a virtual Linux machine. For more information on how to run Ubuntu Linux on Windows check out this article: https://www.8bitavenue.com/2012/08/how-to-run-linux-on-windows

Preparing the Environment

Which Unix shell to use is a personal choice but I prefer working with TCSH. Here is how to install TCSH:

    1. Get the binary:

    1. Change the shell:

    1. Set some environment variables at startup

Installing Subversion and Git

Apply the following commands:

Installing OpenCV

Sikuli uses OpenCV computer vision library which is written in C++. Installation from source on Linux is probably a problematic task. If you are having difficulty installing the library you can refer to the following article which outlines all the steps to get this job done:

https://www.8bitavenue.com/2012/08/installing-opencv-on-ubuntu

Installing Node.js

Arrow framework uses Node.js (server side java script). Here is how to install node on Linux:

Installing Node Package Manager (NPM)

Installing Arrow Framework

Installing Arrow Tutorial

Installing Java Development Kit (JDK)

Install Selenium Stand Alone Server

Search for selenium stand alone server for example: http://selenium.googlecode.com/files/selenium-server-standalone-2.22.0.jar

Installing Eclipse

Sikuli is distributed as a Java jar file. This means we can use Java directly to access the imaging API or use a scripting language such as Jython. If you prefer Java you can take a look at the following article which outlines how to install Eclipse on Ubuntu Linux:

https://www.8bitavenue.com/2012/08/installing-eclipse-on-ubuntu

Installing Sikuli on Linux

Follow the steps below:

Installing Jython on Linux

Follow the steps below:

Installing XML-RPC JavaScript Module

Installing Sikuli Server

We are going to expose Sikuli API using a remote XML-RPC server. Here is the jython script for the server:

Sikuli XML-RPC JavaScript Client

As indicated earlier, Sikuli API is exposed using XML-RPC server implemented in jython. Arrow framework test cases written in JavaScript should be able to communicate with Sikuli server using the following JavaScript XML-RPC client:

Arrow Communicating with Sikuli

In order to make sure a java script based test case in Arrow can talk to Sikuli server do the following:

That is it, if you have any questions please contact me. Thanks for reading.

2 Comments

Add a Comment

Your email address will not be published. Required fields are marked *