TestResults.io
  • What is TestResults.io
  • System Architecture
  • Regulated Markets
    • Health Care Industry
    • Financial Services Industry
  • What's new?
    • Update Instruction
      • Update of the Designer extension in Visual Studio
      • Update the Execution Engine
      • Update the Base- and Environment Models
    • Migration to new project file
  • Designer
    • Overview
    • First Steps
    • Installation
    • TestResults.io solution
    • The development environment
      • Tool Window Overview
        • Test Environments
          • Steps to configure a SUT VM
          • How to access files on the system under test
        • Remote Viewer
          • Control Mode
          • Capture Mode
          • Screen Editor
          • Capture Single Image
        • Screen Explorer
        • Test Case Designer
        • Image Explorer
        • API Testing
        • TestResults.io options
          • Engines
          • Servers
    • Test Cases
      • Adding Test Cases
      • Test Case structure
      • Simple Test Case (Example)
      • Executing your Test Case
      • Generating Test Containers
      • Publishing Test Cases
      • Execution Variables
    • Software Models
      • Adding SW Models
      • Referencing the Model in the Test Case
      • Generating Test Containers
      • Publishing SW Models
      • Screens and Screen Elements
        • Tables
        • Visual Sense
        • Custom Screen Elements
    • Installers
      • Adding Installers
      • Generating Test Containers
      • Publishing Installers
    • Automation Framework Reference
      • Attributes
      • Enumerations
      • Filters
        • IImageFilter Interface
        • Select
        • Resize
      • GlobalEngineParameters
      • ImageDetectionParameters
      • ImageReference
      • Interfaces
        • ITester Interface
          • ITester Methods
          • ITester Properties
        • ITestee Interface
          • ITestee Methods
        • IConnections Interface
          • IConnections Methods
          • IConnections Properties
        • IDebug Interface
        • IEngineResult
        • IHelpers Interface
        • IImageHelper Interface
          • IImageHelper Methods
        • IKeyboard Interface
          • IKeyboard Methods
        • IMouse Interface
          • IMouse Methods
          • IMouse Properties
        • IReport Interface
          • IReport Methods
        • ISUTConnection Interface
      • OcrEngineParameters
        • Best practise
        • IronOcrEngineParameters
        • LEADOcrEngineParameters
        • OcrEngineRelatedCharacters
        • OcrPreprocessingParameters
      • ResultRectangle
      • SutNotReadyException
      • TestStepAbortedException
    • FAQ
      • Two-factor authentication (2FA) and One Time Passwords (OTP)
      • Receive and verify Emails
      • Using Excel as test data source
      • Verify PDF Content
  • Portal
    • Overview
    • First Steps
    • User's Guide
      • Login
      • Projects
      • Dashboard
      • Test Cases
      • Software & Environments
      • Test Sets
      • Job Queue
      • Management
      • Notifications Summary
    • Automation Engineer's Guide
      • Test Automation Workflow
      • Automating a test case
      • Enabling Software & Environments
    • REST API Reference
      • Authentication
      • Projects
      • Test Sets
      • Test Cases
      • Test Plans
      • Test Reports
      • Files
      • Software
      • Environments
      • Untitled
      • Executions
      • Favorites
      • Statistics
      • User Management
      • Customer Management
      • Notifications
      • Configurations
      • Invoicing
  • Models
    • Overview
    • Base Model
      • BaseScreen
        • BaseScreen Properties
        • BaseScreen Methods
      • OnScreenElement
        • OnScreenElement Methods
        • OnScreenElement Properties
      • Primitives
        • Button
          • Button Methods
          • Button Properties
        • Checkbox
          • Checkbox Methods
        • ContextMenu
          • ContextMenu Methods
          • ContextMenu Properties
        • Dropdown
          • Dropdown Methods
          • Dropdown Properties
        • DropdownMenu
          • DropdownMenu Methods
          • DropdownMenu Properties
        • GenericScroller
          • GenericScroller Methods
          • GenericScroller Properties
        • HorizontalScroller
        • IconButton
          • IconButton Properties
        • Label
        • LabelWithButton
          • LabelWithButton Properties
        • LabelWithCheckbox
          • LabelWithCheckbox Properties
        • LabelWithValue
          • LabelWithValue Methods
          • LabelWithValue Properties
        • PwTextBox
          • PwTextBox Methods
        • TextBox
          • TextBox Methods
          • TextBox Properties
        • Tables and lists
          • Column
            • Column Methods
            • Column Properties
          • ItemList
            • ItemList Methods
            • ItemList Properties
          • Row
            • Row Methods
            • Row Properties
          • TableBase
            • TableBase Methods
            • TableBase Properties
        • LabelWithElementBase
          • LabelWithElementBase Properties
      • Enumerations
      • Extensions
        • EngineResultExtensions Methods
        • EnumExtensions Methods
        • ReportExtensions Methods
        • StringExtensions Methods
        • TesterConnectionExtensions Methods
        • TesterDebugExtensions Methods
        • TesterHelperExtensions Methods
        • TesterMouseExtensions Methods
        • TesterOnScreenElementExtensions
        • TesterSelectExtensions Methods
      • Helper Classes
        • BaseModelHelpers
          • BaseModelHelpers Methods
          • BaseModelHelpers Properties
        • Attributes for Designer
        • ListHelpers
      • Exceptions
        • ElementNotFoundException
        • InteractionFailedException
        • ScreenNotFoundException
      • Interfaces
        • IAppBasics Interface
          • IAppBasics Methods
          • IAppBasics Properties
        • IBrowser
        • ICommandLineWindow
        • IScroller Interface
          • IScroller Methods
          • IScroller Properties
        • ISutLocale Interface
          • ISutLocale Methods
          • ISutLocale Properties
        • ISystemHelpers
        • ISystemInteractions
        • IWindow
    • Environment Model
      • Windows
        • Screens
          • CmdWindow
            • CmdWindow Methods
            • CmdWindow Properties
          • FileDialog
            • FileDialog Methods
            • FileDialog Properties
          • FileExplorer
            • FileExplorer Properties
          • RunWindow
            • RunWindow Methods
            • RunWindow Properties
          • Window
            • Window Methods
            • Window Properties
        • SutLocale
          • SutLocale Methods
          • SutLocale Properties
        • SystemHelpers
          • SystemHelpers Methods
          • SystemHelpers Properties
        • SystemInteractions
        • WebBrowser
          • Browser
            • Browser Methods
            • Browser Properties
          • BrowserScroller
            • BrowserScroller Methods
            • BrowserScroller Properties
          • AuthenticationDialog
            • AuthenticationDialog Methods
            • AuthenticationDialog Properties
          • DownloadDialog
            • DownloadDialog Methods
            • DownloadDialog Properties
        • EnvironmentModel Enumerations
        • Interfaces
          • IWebAppBasics
            • IWebAppBasics Property
Powered by GitBook
On this page
  • Overview
  • ITester
  • [TestCase(number)] tag
  • [SetupTest] tag
  • [PreconditionStep] tag
  • [TestStep] tag
  • [CleanupStep] tag
  • [TearDownTest] tag

Was this helpful?

  1. Designer
  2. Test Cases

Test Case structure

Overview

Once you open your newly created test case you will find several tags present within the file. All of those tags are explained within this chapter. You will also find the details of the ITester interface (engine and execution access).

Example Test Case
using System;
using Progile.ATE.Common;
using Progile.ATE.TestFramework;
//using Example_Model;

namespace TC001_Rev1
{
    [TestCase(1)]
    public class MyFirstTestCase
    {
        //  reference the software model
        //  private ExampleApp App { get; set; }

        [SetupTest]
        public bool Setup(ITester t)
        {
            //App = new ExampleApp(t);
            return true;
        }

        [PreconditionStep]
        public void PreconditionStep(ITester t)
        {
            // Example for usage of software model:
            //App.ExampleScreen.WaitFor();
            //App.ExampleScreen.ExampleAction("superuser", "safePW");

            t.Report.FailStep("REPLACE_OR_DELETE_ME");
            t.Testee.Mouse.Click(text: "Google Search");
        }

        [TestStep(1,
            TestInput = "TestInput1",
            ExpectedResults = "Expected1")]
        public void Step1(ITester t)
        {
            t.Report.FailStep("REPLACE_ME");
        }

        [CleanupStep]
        public void CleanupStep(ITester t)
        {
            t.Report.FailStep("REPLACE_OR_DELETE_ME");
        }

        [TearDownTest]
        public bool TearDown(ITester t)
        {
            return true;
        }
    }
}

ITester

[TestCase(number)] tag

This tag "tells" the engine that the class is a test case. The number part represents the revision number of the test case.

Example 1: Test Case Revision 1 is represented as [TestCase(1)]

Example 2: Test Case Revision 7 is represented as [TestCase(7)]

Do not delete the Test Case tag from the class. Otherwise the engine will not be able to recognize the class as Test Case.

[SetupTest] tag

Within this tag the test case instantiates the test model. The underlying method needs to return true in order for the test case to work. If the method returns false the test case will abort.

 [SetupTest]
        public bool Setup(ITester t)
        {
            App = new ExampleApp(t); //test model instantiation 
            return true; // method needs to return true
        }

[PreconditionStep] tag

Within the method defined with this tag you specify the actions necessary to fulfill the preconditions. The action function needs to return true in order for the PreconditionStep to pass. You can report that the step passes or fails as follows:

        [PreconditionStep]
        public void PreconditionStep(ITester t)
        {
            // Actions to fulfill the Preconditions
            t.Testee.Mouse.Click(text: "Run");
            
            if(t.Testee.FindImage(Images.Software.RunningState).HasSucceeded)
            {
                //PassStep will return true
                t.Report.PassStep("Software is in runing state");
            }
            else
                //FailStep will return false
                t.Report.FailStep("Software is not in running state");            
        }

[TestStep] tag

Within the method defined with this tag you specify the test step actions. The tag has additional attributes which define the steps number, test input and expected results.

[TestStep(1,
            TestInput = "Click on the LogIn button",
            ExpectedResults = "Login is not successfull as the user creneditals are not enetered")]
        public void Step1(ITester t)
        {
            t.Testee.Mouse.Click(Images.Software.LogIn);

            if(t.Testee.FindImage(Images.Software.LoginPage)
                t.Report.PassStep("LogIn button is not successfull as the user creneditals are not enetered");
            else
                t.Report.FailStep("Login was successfull");
        }

Tag attributes:

Attribute

Type

Description

Mandatory

Example usage

sequence

int

Defines the step number

Yes

[TestStep(1)]

TestInput

string

Defines the test input

Yes

[TestStep(1,

TestInput = "Click on the LogIn button")]

ExpectedResult

string

Defined the steps Expected Results

No

[TestStep(1,

TestInput = "Click on the LogIn button",

ExpectedResults = "Login is not successfull")]

[CleanupStep] tag

Within the method defined with this tag you specify the actions necessary to fulfill the cleanup step. The action function needs to return true in order for the CleanupStep to pass. You can report that the step passes or fails as follows:

        [CleanupStep]
        public void CleanupStep(ITester t)
        {
            // Actions to fulfill the CleanUp
            t.Testee.Mouse.Click(text: "Stop App");
            
            if(t.Testee.FindImage(Images.Software.StopState).HasSucceeded)
            {
                //PassStep will return true
                t.Report.PassStep("Software is stopped");
            }
            else
                //FailStep will return false
                t.Report.FailStep("Software is not stopped");            
        }

[TearDownTest] tag

Within this tag the your tear down your test. The underlying method needs to return true in order for the test case to work. If the method returns false the test case will fail.

 [TearDownTest]
        public bool TearDown(ITester t)
        {
           return true; // method needs to return true
        }

PreviousAdding Test CasesNextSimple Test Case (Example)

Last updated 6 years ago

Was this helpful?

The ITester interface allows you to access the functionality of the engine. There are several way in each you can use the interface. Please refer to the chapter for full details regarding the available options.

Object References