When starting working with Sikuli, the first task is to think through the folders and files structure and general configuration. While doing that, there are a couple of things to take into account. I will split them into two parts:
By default, when the installation process is finished, Sikuli folder will be created. The folder will include everything Sikuli needs to run. However, as we go, we will add more directories and files to this structure.
First, few things to keep in mind before we start:
- Sikuli configuration
- Workstation/Desktop configuration
Sikuli folders structure and configuration
First, few things to keep in mind before we start:
- Do put the Sikuli folder too deep
The general recommendation is not to have the Sikuli folder buried too deep inside other folders. Hence, probably the place to be is on C:\ drive itself.. Especially try to avoid path that includes folders with spaces and/or non-English characters. So the best option will be something like that:
C:\SikuliX - Give correct names to the tests and the test folders. Each test scenario must be a file with "*.py" extension located in a folder with a similar name but post fixed with ".sikuli". For example:
C:\SikuliX/Tests/Test1.sikuli/Test1.py - Place all you files under the main folder. Consider putting all your tests and configuration files in a folder located somewhere under the main SikuliX folder. That will make your life much easier if you decide to migrate your Sikuli to another PC/environment. So since the installation by itself is just unpacking and downloading additional files, you can later just copy the whole folder anywhere you
want.
- Keep the images in one place. As the number of your test cases will grow, the number of related images and patterns will grow with them. I recommend to create a separate folder and place it somewhere under Sikuli (as mentioned in the previous paragraph), rather than keeping a set of images separately for each test scenario. It is much more convenient for image management and re usability. To set the "Image Search Path", use the following command:
More information regarding code and images reuse and image search path can be found here:
http://doc.sikuli.org/globals.html#importingsikuliscripts
http://doc.sikuli.org/globals.html#imagesearchpath
http://doc.sikuli.org/globals.html#setBundlePath
Workstation configuration
- Eliminate issues with font-edge smoothing.That issue was driving me crazy when I just started working with Sikuli and had to copy my tests on another PC and 50% of my tests just became useless as the images were not recognized anymore. So after comparing the some screenshots from 2 different machines, I've found out that on the other PC, the fonts were a bit smoothed and that what caused Sikuli to fail finding the objects. To solve that issue, untick the "Smooth edges of screen fonts" option which is located under Performance Options -> Visual Effects.
Comments
Post a Comment