Use with existing projects | Ranorex Webtestit User Guide
WebtestitUser GuideUse with existing projects

Using Ranorex Webtestit with existing projects

In many scenarios, the automated tests are part of the source code of the website or application you are developing. Those projects are created by an integrated development environment (IDE), like IntelliJ IDEA or Visual Studio. You can use Ranorex Webtestit to open existing projects from other IDEs and edit the test cases in it, as long as you follow a few basic rules.
Note icon

Note

Editing tests in existing projects will only work if your test environment uses one of the supported test frameworks. If you are using different frameworks for test execution, Ranorex Webtestit will not be able to integrate.
Structure of this chapter
    To get started, open the root folder of your development project in Ranorex Webtestit. In the following dialog, you need to provide some information to create a new Ranorex Webtestit configuration file. This mainly concerns a project name and the language to be used.
    After adding a configuration file, you can use the Project tab to browse your files. You can add new Page Objects and Test files as you would in an empty project.

    How to make existing files work with Ranorex Webtestit

    Ranorex Webtestit relies on contextual comments in your source files to identify them as core objects. Core objects are test files or Page Object files and cause the Ranorex Webtestit UI to adapt. Existing Page Object files in your project need to be modified in order to use functionality like Drag&Drop or to add selectors using Ranorex Selocity. To make a Page Object file detectable as such, you need to add the following comment in the first line of the file: // Ranorex Webtestit Page Object File In the Project tab, the file will change its icon and look like you’ve created it in Ranorex Webtestit. The editor will display the special comment in a different color and the user interface will enable you to create selectors without the need of writing code.
    In test files you need to specify them by applying the following comment in the first line of the file: // Ranorex Webtestit Test File If you click on a test file modified like this, Ranorex Webtestit will open the Execution tab and enable you to directly run it on configured endpoints.

    Adding new elements

    You can add new Page Object files and test files to your existing project as you would in your Ranorex Webtestit Project. Simply refer to the Project tab and select the folder where you want to create your new files (or create a new one). Right-click the folder and select New > Page Object file to add a new Page Object, or New > Test file to add a new test. Ranorex Webtestit automatically scans your project infrastructure for tests and will execute them if you hit the Run all test files button in the Execute tab.