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:

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.

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Progile.ATE.Common;
using Progile.ATE.TestFramework.Filters;
using Progile.TRIO.BaseModel;
using Progile.TRIO.BaseModel.Extensions;

using static TestImages.MyFirstSoftware;


namespace MyFirstSoftware_Model.Screens
{
	public partial class  MyFirstScreen : BaseScreen
	{
		public  MyFirstScreen(IAppBasics appBasics) : base(appBasics, "MyFirstScreen", Images.Screens.MyFirstScreen.Opened.MyFirstScreen)
		{
        }
        
		public Button DirectContact { get; private set; }
		  
		public TextBox YourName { get; private set; }
		  
		public TextBox YourEmail { get; private set; }
		  
		public Label EmailUs { get; private set; }
		
        protected override void Initialize()
        {
            base.Initialize();

              
		    DirectContact = new Button(testInterface:t,displayName:"DirectContact",searchType:Progile.TRIO.BaseModel.SearchType.Image,content:Images.Screens.MyFirstScreen.DirectContact,filters:ScreenSelect);
		      
		    YourName = new TextBox(testerInterface:t,displayName:"YourName",imageName:Images.Screens.MyFirstScreen.YourName.YourName,filters:ScreenSelect);
		      
		    YourEmail = new TextBox(testerInterface:t,displayName:"YourEmail",imageName:Images.Screens.MyFirstScreen.YourEmail.YourEmail,filters:ScreenSelect);
		      
		    EmailUs = new Label(testerInterface:t,displayName:"EmailUs",searchType:Progile.TRIO.BaseModel.SearchType.Image,content:Images.Screens.MyFirstScreen.EmailUs.EmailUs,filters:ScreenSelect);
		    
        }
	}
}

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.

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Progile.ATE.Common;
using Progile.ATE.TestFramework.Filters;
using Progile.TRIO.BaseModel;
using Progile.TRIO.BaseModel.Extensions;

using static TestImages.MyFirstSoftware;


namespace MyFirstSoftware_Model.Screens
{
	public partial class  MyFirstScreen 
	{

	    public void EnterDetailsAndSend(string name,string emailName)
	    {
           YourName.Enter(name);
           YourEmail.Enter(emailName);
           DirectContact.Click(DirectContact.WaitForDisappear);
	    }
	}
}

Editing a Generated Screen

Refer to the chapter about the Screen Explorer for details about how to edit an already generated screen.

Last updated