Search code examples
user-interfacejenkinssizeresolutionsikuli

Sikuli changing screen size


We are running Sikuli for GUI (image verification) testing.

We are running the scripts at Local and Jenkins level, where script is developed first using images grabbed from local machine and used to test on Jenkins.

The problem is the test cases are passing on the local machine level but consistently failing at the Jenkins level.

Here are some things that we have noted that could be causing this: Screen resolution between Jenkins and Local machine is different

  • Screen resolution and/or size is different from Jenkins and Local machine
    • Local machine resolution is 1920x1080x24
    • Jenkins machine resolution is set by xvfb 1920x1080x24
    • However the screen size on Jenkins machine when running the script is set at 1440x810
    • We have currently not found a way to adjust this screen size using Sikuli; any suggestions to change screen size using Sikuli or other tools would be great.
  • Browser version between Jenkins and Local machine is different
    • Jenkins is using firefox webdriver
    • Local machine is using firefox webdriver
    • We think of this as the issue bc the screenshot artifacts from the Jenkins machine is showing seemingly different font shapes to the eye; we say shapes bc obviously they are of the same font size, style, etc.

Solution

  • Just want to answer my own question:

    GUI (image/pixel) using Sikuli is dependent on the following factors:

    • Browser type
    • Screen resolution
    • Screen size
    • OS

    These are outside the scope and not configurable within Sikuli (and also preset according to the tech stack used by the team) so it is best to align the development and test execution machine as much as possible.

    The reason being the following formula is used when matching images, which is constrained to a grid.

    enter image description here

    Next option is to use the OCR capability of SikuliX.