Skip to content

Architecture Overview

smysnk edited this page Mar 14, 2013 · 13 revisions

Background

SikuliFramework is a combination of three ideas, explored in the blogs below:

Project Structure

/src           Sources
/examples      Code examples
/results       Logs/Screenshots created during execution 
/java          Java dependencies

Entity Class

In SikuliFramework there is one primary atomic class, the Entity class which all other Windows, Buttons, Textboxes, etc. are sub-classed from. Some of the more important aspects of the Entity class are listed below:

  • Has a name, usually take from the ClassName or in the case of Buttons it is the first argument in the definition (eg. ['myButton', Button] )
  • Has a parent entity unless it an Application (parent) entity
  • Has a validated/invalidated state
  • When validated it has a defined Sikuli region (entity.region)
  • Has children Entites defined as member-variables of its own class (eg. Dialog.OK, Dialog.CANCEL)
  • Has special Getter Method (eg. entity[Dialog.OK] )
  • Will automatically instantiate the Entity member-variable
  • If already instantiated once before will return back the original
  • To perform any type of GUI interaction with an entity it must validated
  • Validation
  • Entities can be dependant on their parents being validated first before they can be validated
  • Successful validation depends on the RegionFinder class (Role is to find the Entity on the screen)

Baseline (/examples/{name}/baseline) structure

We use the term "baseline" images to refer to the images we've captured to of the application we want to automated or test. SikuliFramework will search this directory in the order denoted below. The search order goes from specific to general.

For example (full list is longer):

/os/windows/win7/en
/os/mac/10.7/en
/os/windows/win7
/os/mac/10.7
/os/windows/en
/os/mac
/os/windows/en
/os/mac
/