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
  • Step 1: Take an image of the Home item in the Remote Viewer
  • Step 2: Change the Precondition to use the taken image
  • Step 3: Take an image of the Contact us item in the Remote Viewer
  • Step 4: Click on the Contact Us button in the Remote Viewer
  • Step 5: Take an image of the CONTACT US Header
  • Step 6: Change Step 1 in your code to use the taken images

Was this helpful?

  1. Designer
  2. Test Cases

Simple Test Case (Example)

PreviousTest Case structureNextExecuting your Test Case

Last updated 5 years ago

Was this helpful?

Overview

In this chapter we will create a simple test case with only one test step. The test case will look as follows:

Step No.

Test Input

Expected Results

Preconditions

The progile.ch home page is displayed in the WebBrowser

none

1

Click on the Contact Us link in the top of the screen

The Contact Us page is displayed

Follow the Steps below to create your first simple test case:

Step 1: Take an image of the Home item in the Remote Viewer

Access the Remote Viewer and draw a rectangle around the Home menu item. We will use this button to check if the Preconditions are met.

Save this image with the Default parameters in the Test Case project in a unique directory e.g.

\yourTCprojectDir\Images\TopMenu\Home\Home.png

Step 2: Change the Precondition to use the taken image

 [PreconditionStep]
    public void PreconditionStep(ITester t)
    {
        if (t.Testee.FindImage(Images.TopMenu.Home).HasSucceeded)
            t.Report.PassStep("The progile.ch home page is displayed in the WebBrowser");
        else
            t.Report.FailStep("The progile.ch home page is not displayed in the WebBrowser");
    }

As you see we have referenced the image in the FindImage method and are looking for this image on the system under test. If the image is found we will pass the step, otherwise we will fail it and the test case will not continue.

Step 3: Take an image of the Contact us item in the Remote Viewer

Access the Remote Viewer and draw a rectangle around the Contact us menu item. We will use this button to interact with the SUT.

Save this image with the Default parameters in the Test Case project in a unique directory e.g.‌

\yourTCprojectDir\Images\TopMenu\ContactUs\ContactUs.png

Step 4: Click on the Contact Us button in the Remote Viewer

Once you click on Contact Us button in the Remote Viewer you will be navigated to the Contact Us page.

Step 5: Take an image of the CONTACT US Header

Take an image of the Contact Us header so that we can use it as the check for the correct page being displayed.

Save this image with the Default parameters in the Test Case project in a unique directory e.g.‌

\yourTCprojectDir\Images\Screens\ContactUs\Header.png

Step 6: Change Step 1 in your code to use the taken images

//We define the Test Input and the Expected Results in the tag before the method
[TestStep(1,
    TestInput = "Click on the Contact Us link in the top of the screen",
    ExpectedResults = "The Contact Us page is displayed")]
public void Step1(ITester t)
{
    //we are clicking on the Contact Us item in the Top Menu
    t.Testee.Mouse.Click(Images.TopMenu.ContactUs);

    //we are checking if the Contact Us page has been displayed
    if(t.Testee.FindImage(Images.Screens.ContactUs).HasSucceeded)
        t.Report.PassStep("The Contact Us page is displayed");
    else
        t.Report.FailStep("The Contact Us page is not displayed");
}

What we have done is we have clicked on the Contact Us menu item and are checking if the correct page is displayed afterwards.

In the end our easy test case will look as follows:

using System;
using Progile.ATE.Common;
using Progile.ATE.TestFramework;
using static TestImages.TC001_Rev1;

namespace TC001_Rev1
{
    [TestCase(1)]
    public class MyFirstTestCase
    {
        [SetupTest]
        public bool Setup(ITester t)
        { 
            return true;
        }

        [PreconditionStep]
        public void PreconditionStep(ITester t)
        {
            if (t.Testee.FindImage(Images.TopMenu.Home).HasSucceeded)
                t.Report.PassStep("The progile.ch home page is displayed in the WebBrowser");
            else
                t.Report.FailStep("The progile.ch home page is not displayed in the WebBrowser");
        }
        //We define the Test Input and the Expected Results in the tag before the method
        [TestStep(1,
            TestInput = "Click on the Contact Us link in the top of the screen",
            ExpectedResults = "The Contact Us page is displayed")]
        public void Step1(ITester t)
        {
            //we are clicking on the Contact Us item in the Top Menu
            t.Testee.Mouse.Click(Images.TopMenu.ContactUs);

            //we are checking if the Contact Us page has been displayed
            if(t.Testee.FindImage(Images.Screens.ContactUs).HasSucceeded)
                t.Report.PassStep("The Contact Us page is displayed");
            else
                t.Report.FailStep("The Contact Us page is not displayed");
        }       
    }
}

This is just an example test case. More examples and ways to simplify the test cases will be described in the next chapters.