Screen Editor
Last updated
Last updated
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.
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.
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:
Parameter name
Description
Example
Screen Name
The name of the screen which will be user to generate the class file
MyFirstScreen
Project
Software Model Project to which the new class file will be added to
MyFirstSoftware_1_0
Screen Location
Location of the class in the Project structure
Screens
Screen Loaded Image
An image which will be used to identify that the screen has been opened
ContactUsLogo.png
Screen Rectangle
A screenshot of the screen, used as a preview image
By default the full screen
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
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:
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:
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.
The following items need to be set for the Button element:
Property
Description
Name
Unique name of the element which will be later used to identify it
Search Type
Search Type which is supposed to be use by the engine. It can either be Image or Text
For Search Type Image
Active Image
Image which will be used to find the element on the screen
Inactive Image
In case the button has two states - the image showing the inactive state
For Search Type Text
Search Text
Text which is used to find the control
The following items need to be set for the Checkbox element:
Property
Description
Name
Unique name of the element which will be later used to identify it
Checked Image
Image of the checked state of the checkbox.
Unchecked Image
Image of the unchecked state of the checkbox.
The following items need to be set for the Dropdown element:
Property
Description
Name
Unique name of the element which will be later used to identify it
Base Image
Image used to located the dropdown list. E.g. a label. When defining the base image make sure that the HotSpot is set where the dropdown location is. For instance. The following dropdown
Bottom Image
The bottom line of the expanded dropdown list. This image is used to determine if the list has been expanded or in other words to tell the engine what the end of the list is.
Button Image
The dropdown list button image (in case it is available) e.g. the button used to expand the dropdown.
The following items need to be set for the Label element:
Property
Description
Name
Unique name of the element which will be later used to identify it
Search Type
Search Type which is supposed to be use by the engine. It can either be Image or Text
For Search Type Image
Image
Image which will be used to find the element on the screen
For Search Type Text
Search Text
Text which is used to find the control
The following items need to be set for the TextBox element:
Property
Description
Name
Unique name of the element which will be later used to identify it
Image
Image which will be used to find the element on the screen. Note that the hotspot for the Textbox needs to be defined withing the textbox iteself
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.
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
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.
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.
Refer to the chapter about the Screen Explorer for details about how to edit an already generated screen.
In order to define the Screen loaded Image click the camera icon. As with every image you take you will have two options two choose from:
Select the Select existing image option
should have the base image selected as follows: As you can see the Base Image is the Allow label but the HotSpot is set to the inside frame of the dropdown list