Collections and methods | Ranorex
Help CenterUser GuideRanorex Studio expert

Collections and methods

As a developer or tester with programming skills, you can create user code collections with user code methods, which can then be shared within solutions and teams.

All user code methods within a user code collection of a solution are instantly available in the user code library. You can create multiple user code collections within a project.

In this chapter

    Adding a user code collection to a project

    Select the project in ‘Projects’ view.

    In the main menu, choose File > New > File, or Add > New Item in the context menu.

    In the opened Dialog, choose ‘User Code Collection’ and enter a suitable file name.

    The code file is added to the project and opened. An empty class with the attribute ‘[UserCodeCollection]’ is automatically generated. Only classes with this attribute will be listed in the library.

    Adding a user code method to a user code collection

    Place the mouse cursor between the brackets of the class.

    Open the context menu and click Insert New User Code Method.

    Fill in a suitable method name for the new user code method and press OK..

    The stub for the new method is created. All user code methods have to be attributed with ‘[UserCodeMethod]’ to be available in the user code library.

    Write the code for the new method.

    Update the summary to provide a suitable description. This description will be available in the library and helps your colleagues in finding the method they are looking for.