Instant Sikuli Test Automation – A book review

Review of "Instant Sikuli Test Automation" By Ben Lau, Published by Packt Publishing in their "Instant" series, BIRMINGHAM – MUMBAI, 2013 SBN 978-1-78216-787-7

It is always dangerous applying the word "Instant" to any process requiring download and installation of software.  On page four, the authors offer a direct link to the then-current version of Sikuli.  The link is wrong, because the version has moved on.

The project is now at version 1.0.1 and "[sic] We now have a setup, only one jar containing all stuff, native libs folder and needed settings created at runtime on the fly, some more bugs fixed and those from version 1.0.0 that hurts"  The "all-downloads" link did work.

My Rig: I am testing the application on a Windows 7 virtual machine within Oracle VirtualBox running on my usual testing machine, an HP Pavillion dv6000 laptop running a heavily-modified version of Ubuntu Studio 13.04.  I do not usually program on a Windows platform.  Before I installed Sikuli, I made sure I was running the newest version of the Java JRE.

1. I left the jar file in my downloads folder and doubleclicked it.  It created two files and a dialog saying to double-click on  runSetup.cmd.Sikuli-01

2. This opened the terminal-emulator and a dialog that tells us to read carefully.Sikuli-02
3. The next dialog gives us a large collection of usage profiles, of which we can choose more than one.  I chose #1 because I want to see the Sikuli IDE and also #6 because I want to use the created packages on any platform.  The buttons on the right-hand margin open potentially useful information to choose your set-up options.  They say the Testeract packages (option 5) are large and potentially buggy. They caution new Sikuli users to not install this feature.  There are some people, like me for instance, who like to install all available options, so the cautionary sentence is a really helpful addition.  They need to edit this installation dialog to say the "[…] buttons" which are whay exist, instead of the "[?] buttons" which do not.Sikuli-03

4. Last-chance DialogSikuli-04

5. You might have to turn off your firewall.  Comodo puts everything it doesn't understand into a sandbox and makes installs that use multiple calls to the internet from multiple applications.Sikuli-05

6. Installation is ending.  Testing the jython popup…Sikuli-06

 

7. …which create a popup. Then it let out a final burp to tell us where the install log was.  In this case, it is in the Downloads folder, where the original jar file was put.Sikuli-07

8. The Sikuli-ide.jar file is also in the Downloads folder.  This is good to know, since the Downloads folder is not a safe place to store files you are using, i.e., sikuli applications, web browsers and important papers.  People are known to delete the files from the Downloads folder from time to time.  Now for the purpose of my review, I will leave it here, but I would suggest you copy the original install folder to a safer location, like c:usersyour-profilebinSikuli.  This is where I put programs I am working on, or im my Linux environment /home/wolf/bin/.

Sikuli-08
9. The runIDE.cmd opens a terminal-emulator, which after a prudent interval causes the sikuli-ide.jar to fire up.
I am going to run their "HelloSikuli" program.  With any luck my screenshots should look a lot like theirs.Sikuli-09

10. Saving my script as demo1.sikuli.Sikuli-10

11. Jython dialog comes up showing it is setting up the environment.Sikuli-11
12. The IDE came up with an error saying C;Program FilesFoxit SoftwareFoxit_Reader.exe did not exist.  This is good because a semicolon after the drive letter should create an issue, and the bad path also should create an error.  So I changed that to a colon and the path and ran the script again.Sikuli-12

It was a success! Foxit Reader opened from the Sikuli IDE as advertised.Sikuli-13

13. I went back to the tutorial because the next command won't work with Foxit Reader.  To make this work, wordpad has to be open already.  Otherwise, it opens with an error message that it cannot open the document.  With wordpad open, I watched the program type my input line in the default document.Sikuli-14
14. The next few lines brought me an error message and no way to clear it.  The error was that there was no viable input where the line 6 info should have made wordpad highlight the content [ctrl]a means "select all."
After about 30 minutes of searching for the error and not finding it, I noticed there was a missing ")" at the end of line 4.  Now it worked, but caused the same "Failed to find document" error in starting wordpad.  There is no information about this oddity online or in the book.Sikuli-15

15. The script ran, and though it couldn't open wordpad without an error, it typed on the open wordpad document and replaced the text.  It ran the hot-key macros without any problem [ctrl]"A" and [alt][F4]; and even managed to click a button onscreen.  I can see how it could be useful in some situations, i.e., web-form testing from the GUI or even automating inserting of data into a series of web-forms or application forms.  Selenium still seems more straightforward to me, but if you have an afternoon to play with a new testing tool, try Sikuli.Sikuli-16

As far as "Instant Sikuli Test" Automation by Ben Lau, considering that the first 9 pages took 3 hours to get through with lots of internet research taking up the bulk of the time, I am reconsidering the time required to get through this slim volume.  This would probably be a good refresher for an experienced programmer who used Sikuli before, but it really doesn't address a beginning programmer's needs.

Speaking only for myself, a perpetual beginner in programming, with a very full plate of other things to do; if a client required me to use Sikuli for some reason, I would get this book, so I could thumb through it for ideas as I was implementing test-driven programming. I want to try it on my own Linux platform at some point to see if I am happier with Sikuli, but since the majority of the illustrations past chapter one are done on a Mac, it became more friendly to me after page 15.

Original review publshed on wolfhalton.info