Image-based automation at a glance | Ranorex
Help CenterUser GuideRanorex Studio advanced

Image-based automation at a glance

During the introduction of this chapter, we showed an example where default automation (i.e. text-based automation) fails since it is based upon the absolute and relative screen position of UI-elements within the graphical user interface. This chapter introduces the simple, but a mighty concept of image-based automation and its easy application.

In this chapter

    Test example preparation

    As shown during the introduction of this chapter, the test case is based on a calendar view which may change between the initial test recording and the test run(s).

    Image-based test example preparation

    Image-based test example preparation

    Start the demo application and select Image-based automation as working environment.
    In Ranorex Studio, create a new solution without the Solution Wizard and open Recording1 in this solution.

    In the recording module view of Recording1, click RECORD.

    Image-based recording

    Now we record the previous test again and in image-based automation mode.

    Recording calendar dates in image-based automation mode

    Recording calendar dates in image-based automation mode

    Switch to Image based automation by activating the corresponding switch.
    Record (click) the three dates ’24’, ’25’ & ’26’ of the current calendar view in the demo application
    This will lead to an actions table containing three corresponding action items where the UI-elements have been recorded in image-based automation mode
    Note icon

    Note

    Image-based automation differs from (default) text-based automation also in a graphical way. Ranorex Recorder outlines the identified UI-elements during recording with green frames (image-based automation) instead of purple frames (text-based automation).

    Green UI-element detection frame during image-based automation

    Green UI-element detection frame during image-based automation

    Text-based validation with purple framed validation element
    Image-based validation with green framed validation element

    Test result

    The test result, when running with the recording conditions at run-time, is the same as with the default text-based automation mode.

    Test result in image-based automation mode

    Test result in image-based automation mode

    Result(s):

    • The test report outlines the three executed action items
    • Ranorex Recorder correctly identifies the previously recorded calendar dates 

    Change of test conditions

    Assume, again, the change of test conditions in a way, that the calendar view changes to a different month with the dates being at different positions and watch out the result of the image-based automation.

    Changed calendar view

    Changed calendar view

    Change the calendar view from January 2018 to February 2018

    Test result with the changed test conditions

    Now see the test result of the recorded test with changed test conditions and a different calendar view.

    Image-based test result with changed test conditions

    Image-based test result with changed test conditions

    Result(s):

    • The dates are at different locations within the calendar view
    • Nevertheless, Ranorex identifies the previously selected dates ’24’, ’25’ & ’26’ correctly!