Screen Editor
Overview
The screen editor allows you to easily generate code (generate C# classes) based on the controls you have marked on the screen. That allows you to create your test model quickly and efficiently as you don't need to define your screens manually. Once you generate a screen you will not have to worry about defining any controls as they will already be a part of the generated code.
TestResults.io nuget package
The screen editor will use specific predefined controls which are defined within the TestResults.io Base Model Nuget package. In to restore the nuget package simply build you TestResults.io solution. In this way you will be sure that the correct Nuget package will be downloaded from the the nuget server.
Adding the Screen Information
Once you have enabled the Screen Editor you will notice the Screen Information in the top. This section is mandatory and you need to fill in the following parameters:
Capture new image - if you select this option you will be able to take a new image
Select existing image - if you select this option you will be able to select an existing image
Capturing new image
Make sure you disable the Control Mode and draw a rectangle around the desired image and select Save Image
You will not be prompted to Save the image on your hard drive. The image you have saved will be stored in the memory until the screen is generated.
After pressing Save you will see that the Open image section has been filled with the file name of the image you have taken:
Selecting an existing image
Select the desired image from the list of existing images (these images need to exist in your project)
Select Save
You will not be prompted to Save the image on your hard drive. The image you have saved will be stored in the memory until the screen is generated.
After pressing Save you will see that the Open image section has been filled with the file name of the image you have taken:
Adding Screen Elements
You can add elements to your screen definition by selecting the Add element option.
Depending on your selection different sub-menus presenting different options for each element will be displayed. Find more information about the different Screen Elements below or in the description of the Base Model Primitives.
Button element
The following items need to be set for the Button element:
Checkbox element
The following items need to be set for the Checkbox element:
Dropdown element
The following items need to be set for the Dropdown element:
Label element
The following items need to be set for the Label element:
TextBox element
The following items need to be set for the TextBox element:
Additional controls
There are additional controls you can add to the screen e.g. Label With Button, Label With Value. These elements follow the same principals as the main controls. During their definition the Screen Editor will display the information which of components are needed.
Generating the Screen
Once you are done adding the elements to your screen simply press the Generate Screen button
The designer will automatically add two files to your solution:
The files will have the same name as the name entered in the Screen Information section
Partial class with screen elements
The class containing the ".g" in its name e.g. MyFirstScreen.g.cs is a partial class class which contains the auto generated controls.
This class should not be used for coding your methods as it contains the definition of the your screen elements.
Do not modify the auto-generated class as long as your are not 100% certain about the change you are making.
Partial class without screen elements
The class which doesn't contain the ".g" in its name e.g. MyFirstScreen.cs is a partial class class which you can use the add methods that will use the auto-generated elements from the ".g" class.
Editing a Generated Screen
Refer to the chapter about the Screen Explorer for details about how to edit an already generated screen.
Last updated