GDI capture feature | Ranorex
Help CenterUser GuideRanorex Studio advanced

GDI capture feature

The GDI capture feature is part of the Ranorex Spy functionality. The feature is accessible by the context menu of UI-elements within the tree browser view of Ranorex Spy.

To set up test automation scripts, recognition of the UI-elements of the application under test (AUT) is necessary. In some cases, Ranorex cannot detect all the UI-elements of the application under test (e.g. VB6, MFC, older Delphi versions) in a proper way. This is where the GDI (graphic device interface) capture list feature comes into play.

In this chapter

    Non-GDI-based UI-element identification

    Assume a simple example where you need to track & identify a calendar date out of the test application’s GUI.

    Non-GDI-based UI-element identification

    Non-GDI-based UI-element identification

    Start Ranorex Spy and use the track function …
    … to identify the calendar date 25 out of the demo application

    Result(s):

    Sometimes Ranorex is not able to extract and identify distinct elements out of a larger context. The current result is displayed in the image below.

    Result of non-GDI-based UI-element identification

    Result of non-GDI-based UI-element identification

    See the RanoreXPath specification indicating that not a date, but the complete calendar has been identified as resulting UI-element
    See the UI-element in the tree browser view of Spy with the adapter type DateTime (i.e. calendar)
    See the screenshot with the complete calendar identified as UI-element, instead of the date 25 only

    Resulting tree browser view and path editor

    Resulting tree browser view and path editor

    See the UI-element in the tree browser view of Spy with the adapter type DateTime (i.e. calendar)
    See the UI-element in the tree view of the path editor

    GDI capture configuration

    Adding the UI-element to the GDI capture list enables Ranorex to identify the included UI-elements based on the ‘RawText’ adapter class.

    GDI capture configuration

    GDI capture configuration

    Verify to select the tree browser view of Spy
    Select the UI-element which is to be handled by the GDI capture feature
    Open the context menu and click Add class name to GDI capture list
    Confirm the resulting information with OK

    GDI-based UI-element identification

    We now repeat the previous example to see the change in detecting a former non-identifiable UI-element.

    GDI-based UI-element identification

    GDI-based UI-element identification

    Start Ranorex Spy and use the track function …
    … to identify the calendar date 25 out of the demo application

    Result(s):

    Ranorex is now able to identify UI-elements within the former capsuled UI-element on the basis of a special adapter type RawText.

    Result of GDI-based UI-element identification

    Result of GDI-based UI-element identification

    See the RanoreXPath specification indicating that the date 25 has been identified as resulting UI-element
    See the UI-element in the tree browser view of Spy with the adapter type rawtext
    See the screenshot with the date identified as UI-element, instead of the previously identified calendar

    Tree browser and path editor with GDI-based UI-element identification

    Tree browser and path editor with GDI-based UI-element identification

    See the UI-element in the tree browser view of Spy with the adapter type RawText
    See the UI-element in the tree view of the path editor

    Adding a process to GDI capture list

    In addition to complex UI-element classes, processes can also be added to the GDI capture list to be able to track and identify inner UI-elements.

    Adding a process to GDI capture list

    Adding a process to GDI capture list

    If you fail to identify a UI-element within an unknown application, select the parent UI-element of this application and open the context menu
    Click Add process name to GDI capture list

    GDI capture settings

    The GDI settings are accessible through the Ranorex Spy settings.

    GDI capture settings

    GDI capture settings

    Click the SETTINGS… button of the Spy toolbar
    Select the GDI capture settings… button of the General settings dialog

    GDI capture list

    GDI capture list

    The GDI capture list is displayed with both – all registered processes – and all registered UI-element classes.