Click here for the Ranorex 3.x test automation documentation
In some cases it might be required to extend simple recorded user actions like mouse clicks or keyboard inputs with some user specific test automation code. Within Ranorex Studio, the Ranorex Recorder provides the ability to declare user code actions which are executed as standard actions. This feature provides the user with a maximal flexibility in combination with Ranorex Recorder for many different use cases. Here are a few examples:
Within Ranorex Studio each recording manages two types of source code files.
Note: Any change of code should always be made within the recording's UserCode.cs file. The main recording.cs file which contains the Start() method will be overwritten each time the recording is saved.
There are two ways to create user code actions with Ranorex Recorder:
By converting an existing action item into a user code action, the Recorder predefines the name for the code action automatically. Simply rename the code action by changing it within the actions table or by changing the name within the property grid. When adding a new code action via the tool bar button, you'll be prompted to specify the name.
Regardless which way you choose to create your code actions, the Recorder declares a new method using the name of the code action within the UserCode.cs file. Simply use the context menu item 'View User Code' to navigate to the related method within the source file.
