C++ Testing

C++ Test

This document describes how to build a new C++ application with Visual Studio and how to automate a simple control in C++. You can find samples in the samples directory of Ranorex. This sample works with Visual Studio 2003 and 2005.

Prerequisites

  1. Copy the included file RanorexCore.h from the Include directory of Ranorex to the Include folder of your project.
  2. Copy the library RanorexCore.lib from the installation path (lib directory) of Ranorex to the Library folder of your project.
  3. Copy RanorexCore.dll from your installation path of Ranorex (Bin directory) to the Bin folder of your project (or output directory).

Extend your application

Include RanorexCore.h in your sourcefile
C++
#include "RanorexCore.h" 
Call the exported functions of RanorexCore in your source code
C++
HWND button2 = RxFormFindChildText(form, "2", MATCH_EXACT);
 
if ( button2 == 0 )
{ 
       printf(" ERROR: button2 not found\n"); 
       return(3); 
}
if ( RxMouseClickControl(button2) != 0 )
{ 
       printf(" ERROR: button2 click error\n"); 
       return(4); 
}
...
Link RanorexCore.lib with your other libraries. Build and run your application. Go to Samples to find more C++ tests.