Code Generation

How to code generate in Testware Framework Manager

Overview

The code generation process is responsible for converting the page objects in an Object Repository into source code.

The source code is representing a test automation API with associated Low-Level tests.

The conversion will be executed as a flush producing the entire source code in one single operation. The generated source code will automatically be appended into the underlying Visual Studio C# solution.

Code Generate

When code generating thousands of code lines will be created within a few seconds in a structured set of classes according to the Page Object Model Design pattern.

Once the source code has been generated and successfully build the test automation framework will be ready for usage executing existing tests or writing new tests.

The code generation may be considered as an export of files and will not be included in the process of saving a Testware Framework Manager solution.

The example below shows an example of a code generated solution...

images

The application operates with two types of code generators...

  • Code Generator - Producing automation API page objects as source code...
  • Test Generator - Producing automation API Low-Level tests as source code...

As the customization of the source code is handled through extension classes it will be possible to execute the code generation at any time. Thereby adaptions to the Object Repository are easily performed as the web application changes over time.

Code Generating

  1. Choose the Edit->Code Generation entry from the file menu to generate API...
  2. Choose the Edit->Test Generation entry from the file menu to generate API tests...
  3. Choose the Edit->Build Solution entry from the file menu to build the source code...
  4. Examine the generated source code in the Solution Explorer...

The code generation has now been executed and the Solution Explorer updated...

The Video Guide