All articles

Automated testing of Delphi apps

Automated testing of Delphi apps

For a long period of time, issues related to problems with automated testing of Delphi applications are discussed at various resources. Someone can not choose a tool, someone does not know how to make the tool see GUI objects. Both problems are solvable.

Let’s start with a list of tools that support automated testing of Delphi applications:

  • TestComplete is systematic, automated, and structured testing tool, with superior support for .NET, Java, Visual C++, Visual Basic, WPF (XAML), Delphi, C++Builder and web applications.
  • Rational Robot can be used to test many different types of application, including those built using Visual Basic, .NET, Oracle Forms, HTML, Java, C++, PowerBuilder, and Delphi.
  • HP WinRunner supports many environments, including Programming environments PowerBuilder, Oracle Developer, Delphi, Centura, VisualAge Smalltalk, Forte, Janus Grids
  • HP Quick Test Professional (QTP) – Delphi support is released as Delphi Add-In for QTP 9.5
  • … etc.

The list is compiled, now we will look at how to make the tools see the GUI objects of your application.


It is necessary to recompile Bpl with the Debug Information option or an executable module (exe) to compile with Debug Information and the Built With RunTime Packages option disabled.

Rational Robot

To enable support, you must activate the “Delphi” item in the Rational Robot “Tools / Extension Manager” menu. But there are problems here too – not the full set of properties will be determined for all controls. If anyone knows how to win it, write add to the article

NOTE: Inprise Delphi is not supported in Rational TestFactory.

HP WinRunner

Normal recognition of Delphi objects requires recompilation of Delphi projects with WR modules (WinRunner Agent). Also in WinRunner, you must select “Add Winrunner support to your Delphi project” (option available in WR menu Programms -> Winrunner) then in the wizard select the tested Delphi application “filename.dpr” (this wizard adds the “Testsrvr” unit to the project). Now WR will be able to recognize the Deplhi components.

HP Quick Test Professional

After the installation of the Delphi Add-In is complete, run QTP. If you have configured the Add-In Manager to load when you start the application, you will see that the new Delphi Add-In is available in the list of add-ons. In order for the Delphi Add-In to work properly, I recommend that you also activate the VB Add-in.

Next, before you start recording and testing your Delphi application, you will need to use a specific (.pas) module to activate the interaction of QTP and Delphi:

Copy the folder “<QTP installation folder> \ dat \ Extensibility \ Delphi” to your project folder, then add MicDelphiAgent to the Uses section of your project file “project.dpr”

(See QTP help “Enabling Communications Between Professional and Your Delphi Application” for more details).

Then you can write scripts and use Delphi objects in your scripts.


As you have already noticed, to start testing Delphi applications, you will need to either have access to the source code of the application, or ask the developers to add additional modules and change the compilation parameters. Without this, automated testing of Delphi applications is very problematic.