Recipe 42Test a GUI on Linux, Mac, or Windows with Sikuli

Problem

You’re testing a Linux program written with a custom toolkit that’s difficult to automate. Or, you’d like to test a cross-platform application from a single test suite.

Ingredients

  • Sikuli,[276] a Java-based visual GUI testing tool from MIT

  • JRuby,[277] a Ruby implementation written in Java that can call Sikuli’s API

  • The sikuli gem[278] to provide a few convenience wrappers in Ruby

Solution

Sikuli is a GUI testing tool that takes a bit of a different tack than its peers. Rather than finding controls on the screen by metadata such as CSS selectors or automation IDs, Sikuli takes a snapshot of the screen and recognizes controls by their appearance.

This approach presents a ...

Get Cucumber Recipes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.