Welcome to the Ranorex Support Portal

GDI capture feature

In rare cases, Ranorex Studio can’t identify UI elements of an AUT correctly. This applies to certain technologies such as VB6, MFC, and older Delphi versions. In these cases, you can use the GDI (graphic device interface) capture feature to identify these elements correctly. Ranorex Studio supports both GDI and GDI+. You have to enable GDI+ recognition manually. This is explained at the end of this page.

The GDI capture feature is part of Ranorex Spy. You can access it from an element’s context menu in the element tree browser.

On this page, we’ll explain the difference between non-GDI and GDI UI-element identification by way of a simple example in the Ranorex Studio Demo Application: the calendar.

In this chapter

Note Icon


The screencast “GDI capture feature” walks you through information found in this chapter.:

Watch the screencast now

Default, non-GDI UI-element identification

We want to automate the calendar in the Demo Application. For this purpose, we need to identify the UI element for a specific day of a month.

Let’s identify the element by using the track function in Spy:

  1. Start Ranorex Spy and click TRACK.

  2. In the Demo Application, click a specific day, e.g. 25 May.


  1. The RanoreXPath of the new UI element shows that not a specific day, but the entire calendar has been identified.

  2. In the element tree, the UI-element also has the adapter type DateTime (i.e. a calendar).

  3. The screenshot for the UI element also shows the entire calendar, and not just the 25.

Enable GDI capture

As default UI element identification didn’t work in this case, we need to enable GDI capture. To do so, we add the incorrect UI element to the GDI capture list. In our case, this will allow Ranorex Studio to identify the correct UI element based on the RawText adapter class.

  1. In the element tree, select the UI-element you want to be handled by GDI capture.

  2. Right-click it and click Add class name to GDI capture list.

  3. Click OK to confirm the info dialog.

Now we can track the UI element once more.

  1. Click TRACK.

  2. Click a specific day in the calendar, e.g. 25 May.


The UI element is identified correctly based on the RawText adapter .

  1. The RanoreXPath shows that the date a specific day, and not the entire calendar, has been identified.

  2. In the element tree, the UI element has the adapter type RawText.

  3. The screenshot now shows the UI element for the specific day instead of the entire calendar.

Add a process to the GDI capture list

We recommend only adding single UI element classes to the GDI capture list. However, if you need to add an entire process (e.g. for legacy reasons), you can do so in the GDI capture settings, which is explained in the next topic.

GDI capture settings

The GDI capture settings display all added processes and class names. This is also where you can add processes and class names in bulk or by specifying a regular expression. You can access the GDI capture settings from the Settings dialog in Ranorex Studio or Spy.

  1. Click SETTINGS….

  2. In the General tab, click GDI capture settings….

  1. The GDI settings open.

Enable GDI+

GDI+ recognition is turned off by default. If required, enable it manually under Settings > Plugins > Capture GDI+ text.



Get the latest test automation information right in your mailbox.


© 2024 Ranorex GmbH. All Rights Reserved