Getting more reliable results using Image Matching in Cycle.

Getting more reliable results using Image Matching in Cycle.

Problem

While image matching is a powerful capability, it is not always the best tool for the job -- it can tie up a lot of computing resources, and sometimes preliminary work is needed to capture screenshots that will match reliably.

Solution

Image matching enables Cycle to interact with any desktop application for testing or process automation. Cycle uses an image-matching algorithm that enables reliable and smooth image matching, and this algorithm is constantly being improved.  When possible, use keyboard shortcuts (hotkeys) instead of image matching, to maximize execution speed, reliability, and portability. Of course, hotkeys are not always available, and this is when image matching becomes invaluable.

Best practices

To get the best results with image matching in Cycle, follow these tips for any machine that will be running Cycle, including remote clients:

 

  • When Cycle “clicks” on an image, it clicks on the center of the selected image. Crop images such as icons closely for better matching results.
  • In general, image matching is significantly more reliable when all clients running Cycle use the same operating system and desktop theme. Desktop wallpapers should, ideally, be a solid color (as opposed to a striped gradient, for example).
  • Windows clients should operate with a font size of "Smaller -- 100%", otherwise described as "96 DPI".
  • Computer monitors should be set up to operate with 32-bit color depth for cleaner matching. This is particularly important if anything on the screen, such as web pages or software applications, are styled with a striped gradient color.
  • Choose a standard screen resolution across all clients running Cycle. This is particularly helpful when testing applications or webpages with windows that may or may not scroll depending on the screen resolution.
  • Consider setting up clients to operate software windows with a maximized viewport (e.g., fullscreen view), unless this is not supported by user behavior or standard workflow.

 

Additional considerations

Also remember these points when image matching in Cycle:

 

  • By default, Cycle searches for images using approximately a 1:1 pixel match, but the image matching correlation can be adjusted to allow for more or less rigorous matching. To adjust the image matching correlation for one action only, choose an image Step that includes the correlation parameter. To adjust the image matching correlation for all Steps in a Feature File, go to the Settings screen in Cycle.
  • Images must be in .PNG format, as this format is lossless, and enables image matching based on exactly what the user is seeing on the screen.
  • The Image view can be toggled on or off via the Images On/Off button in the Cycle Ribbon.
  • If you are experiencing issues using image and/or mouse Steps with a HiDPI display, try setting your screen resolution to 1600 x 900 or 1280 x 600. The following Feature can be pasted into your Cycle to test this, if it does not result in the mouse moving in a square shape, you may want to consider running Cycle on with one of these suggested screen resolutions.
    Feature: Move the mouse around
    Scenario Outline: In a square
    Given I move mouse to screen location <x> <y>
    Then I wait 500 ms
    Examples:
    |x|y|
    |500|500|
    |570|500|
    |570|570|
    |500|570|
    |500|500|
    • Related Articles

    • Getting Started with Cycle 2

      Log In to Cycle Cloud In order to get started with Cycle 2, you will need to sign up for a Cycle Cloud account, and then download Cycle 2 from Cycle Cloud. The sign up process requires you to verify your email address. Please note, the email address ...
    • Using Cycle's Data Extract Tool

      The Data Extract tool allows you to easily create CSV files from an existing database. The Extract Data window can be accessed via the "Tools > Extract Data..." menu item in Cycle. It can also be accessed from the Inspector panel with the ...
    • How to perform basic math in Cycle using Groovy

      Problem Cycle can increment variable values but does not include steps for simple math Solution Cycle now includes steps to execute simple Groovy statements inline as well as execute complex Groovy scripts. The 2 Cycle steps that execute Groovy are: ...
    • How To Access the Cycle E-Learning Platform (Cycle University)

      The Cycle User Portal was retired with the release of Cycle 2.9.2. The former Cycle E-Learning platform was retired along with the Cycle User Portal. Training materials can be found in the new Cycle University platform. Cycle Labs - Cycle University ...
    • Where can I get help using Groovy with Cycle?

      Cycle now includes steps to execute simple Groovy statements inline as well as execute complex Groovy scripts.  The 2 Cycle steps that execute Groovy are:  I execute Groovy "<GROOVY_STATEMENTS>" I execute Groovy script "<GROOVY_SCRIPT_FILE>" Creating ...