English|Deutsch
Subscribe Ranorex Announcements Feed Ranorex LinkedIn Ranorex twitter Ranorex Facebook Ranorex Google+

Working with 2.X Projects in 3.X Test Suites

In this section you will learn how to use your 2.X recordings and code modules in Ranorex 3.X test cases within the new test suite editor.

Adding 2.X Projects to 3.X Projects

Ranorex 2.X projects are fully compatible (except for the following breaking changes) and can therefore be used within Ranorex 3.X test solutions.

1. Create or open a Ranorex Test Suite Project

In order to use your existing modules within a test suite, it is required to create a new test suite project.

2. Make a backup of your existing 2.X project and add it to the Test Suite Project

Add your existing test project to a 3.0 test suite

3. Confirm that you want to convert your old project

Project version mismatch dialog

Using 2.X Recording Modules

Now you are ready to reuse your existing recording modules. You can simply drag and drop items from the module browser into your test cases or you can add new or existing items using the context menu as follows:

Add an existing recording module to the current test case
Add an existing recording module

Adapting 2.X Data-Driven Recording Modules

The new Ranorex Recorder allows you to add variables without having to write a line of code. The variables can then be bound to action item properties or can be used within a RanoreXPath expression. Please see following section for more information: Lesson 3: Data-Driven Testing

You can easily adapt your existing data-driven test recording modules by doing following:

1. Open your recording file and click on the "Variables..." button in the Ranorex Recorder view

Open the recording's variable dialog

2. Add all variables used in your code

Add variables

3. Open the UserCode file of your recording and remove your existing properties

4. Remove the 'static' keyword from your UserCode methods 

Now you are able to bind your module variables to a data column or parameter within a test case.

Using 2.X Code Modules

In order to call your existing test methods within the Ranorex test suite editor we recommend to add a code module to your project as follows:

1. Select your project in the projects view and click on "Add Code Module"

Add a new Code Module
Add a new code module

2. Call your method by adding it to the end of the "ITestModule.Run()" method

C#

namespace MyFirstTestProject
{
    /// <summary>
    /// Description of AddAndDeleteVip.
    /// </summary>
    [TestModule("A730AB98-9CFE-49D5-BDA7-0CAE6C614866")]
    public class AddAndDeleteVip : ITestModule
    {
        public AddAndDeleteVip()
        {
        }
    
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor = 1.0;

            // Call your existing test method
            Program.ExistingTest();
        }
    }
}

Now you can add your code module to a test case. Please see following pages for more information about code modules:

Breaking Changes

A few changes had to be introduced that can break existing Ranorex 2.X projects when updating to Ranorex 3.X. If your automation project does not work any more after updating to 3.X, please see the following list that explains what has changed and how you need to update your project to make it work with 3.X again:
  • The Delay class has been moved from the "Ranorex.Core" to the "Ranorex" namespace. If the Delay class cannot be found, you need to include the "Ranorex" namespace at the top of the file:

    C#

    using Ranorex;

    VB.NET

    imports Ranorex
  • The IReportLogger interface has been extended. In particular, the signature of the LogText and LogData methods changed and the PreFilterMessages property was added. If you get compile errors after updating stating that your classes do not correctly implement the IReportLogger interface, please update the implementing classes accordingly. See following blog on how to implement the new IReportLogger interface:
    Customizing Ranorex Reports
  • The tree structure for MSAA elements has changed under certain circumstances and potentially includes more levels and elements now. If you do not want to use the new elements, set the MSAA "Filter compatibility level" setting in the "Plugins" tab of the Ranorex settings to "V2X". Otherwise, please, update broken RanoreXPaths accordingly.
  • Text nodes which consist only of white-spaces are no longer appended to Mozilla WebElement.InnerText. Please, update RanoreXPaths and validations that depend on this property and fail accordingly.
  • Some Win32 controls in the tree no longer have the role Form, but a more appropriate role instead. If you want Ranorex to not use the new role, set the Win32 "Use legacy Form role" setting in the "Plugins" tab of the Ranorex settings to "True". Otherwise, please, update broken RanoreXPaths accordingly.
  • Control.Get/SetPropertyValue now use Reflection instead of the ComponentModel. If a property cannot be found, please check that the used name correctly reflects the API name of the property.
  • The ControlNet11 capability is no longer used as the preferred capability for .NET 1.1 controls. As a consequence, the generated path to items with that capability can change (existing paths will still work).
  • With version 3.0.1 Ranorex added basic support for Delphi controls resulting into different RanoreXPaths being generated for many Delphi controls. If you do not want to use the new functionality, set the Win32 "Enable basic Delphi support" setting in the "Plugins" tab of the Ranorex settings to "False".