Test Environments

Overview

The Test Environments tab allows you to manage the test environments against which you would like to start designing your software model and test cases.

By double clicking on an Environment in the list we connect to it.

This live view of a system will be used to build the Software Model of the application you want to test, by recording images of the Screens (Login Screen, Settings Screen, Home Screen etc.) and Screen Elements (Buttons, Textboxes, Checkboxes etc.).

Test Cases can also be executed with the Test Environment connection.

How to get a new Test Environment?

Depending on the type of software you are planning to automate, you will require different test environments. The test environment will contain the Subject Under Test (SUT). Below are a few possible configurations for Test Environments.

A VM is not required, to automate and run your Test cases you can also just use a local monitor of the machine you are running Visual Studio on.

The most common scenario is that you setup a dedicated Virtual Machine on your machine locally using Hyper-V, within your infrastructure or in the cloud.

Use a Local Monitor

The easiest way to setup a Test Environment is to use a local Monitor. In this scenario Visual Studio will capture the image of one of the Screens connected to your system.

In the following example the application we want to test is opened on Display 1 and Visual Studio on Display 2.

Test Cases can also be executed with a Local Monitor as the Test Enviroment. Make sure to not move the mouse cursor or type on your keyboard while a Test Case is running. Interference may abort the execution.

Simulation Environment by using static Image

Testresults.io does not require a live view of a system, but can also run just against a static image (png file). Of course interactions like mouse clicks or typing into a textbox are not possible with this scenario. So it is mainly intended for debugging or tests where no interactions are required like reading and verifying data from a table, pdf etc.

Use a Virtual Machine provided by your IT department

In case your IT department can setup an environment for you, link them these steps to configure the VM with the recommended settings. We will connect to the environment using the VNC protocol which required access to the TCP port 5900. Check your network and Firewall settings to ensure the access is not blocked.

Setup a local Virtual Machine

Hyper-V System Requirements:

  • 64-bit version of Windows Pro, Enterprise, and Education (Home Versions are not supported)

  • Minimum of 4 GB memory

  • 60 GB disk space

  • Depending on your Hardware - Virtualization may need to be enabled in the BIOS (for example for Lenovo Notebooks)

After the wizard is completed, a direct connection to your virtual machine will open in a new window. You can always find your Virtual Machine in the Hyper-V Manager. Double click the SandboxWin11 to connect to it.

After connecting to the Virtual Machine run the "ConfigureVm.exe" located on the C: drive. This will setup TightVNC on the Virtual Machine so you can connect your Visual Studio directly to it. You can also download the .exe here, make sure you execute it as Administrator in the Virtual Machine and not on your local machine.

After you have executed the .exe the Virual Machine will restart.

Give it a moment to restart. After that connect to it by double clicking the "Hyper V Virtual Machine" in the Test Environments list.

Connect to a Test Environment

The TestResults.io designer supports the following protocols which will allow you to connect to the test machine:

Protocol

Conne

Local

Local Monitor

Capture images and run testcases directly on the system you are running Visual Studio on. Requires multiple monitors

VNC

Remote

The target test env. requires a VNC server installed on it.

We recommend TightVNC server.

RDP

Remote

The target test env. needs to have the Remote Desktop Protocol enabled.

Android

Local

The Android device must have the Developer Options and USB debugging option enabled.

iOS

Local

Contact us for details on how to setup access to iOS.

To connect to a Test Environment follow the steps below

  • Select the Add VNC button or any of the other available protocols from the split button in the taskbar of the test environments tool window.

  • Enter the following details of the test environment:

    • Environment Name - a name which will allow you to easily identify the test environment

    • Target system - the network IP or DNS name of the test environment

    • Username - user name for the test environment (only required for RDP)

    • Password - VNC password or user password (for RDP) of the test environment

    • RemoteDirectory - optional connection string for the remote directory containing supporting files, installation files and artifacts for your test case execution e.g. to store files from the test case

Please keep in mind that for the VNC connection the target test environment needs to have the VNC server running in order for the env. to work with the TestResults.io designer.

  • Confirm the entry by pressing the Add button

  • Your test environment will be present in the list of available test environments

In order to connect to your test environment simply double click on the desired environment.

Once the connection with the test environment is established a new window showing the test environment will be shown. This windows is the Remote Viewer window and has several options to interact with the SUT. It will allow you to control your SUT as well as define screens in your software models and take images which can be used by the automation.

Choosing an execution environment

With the dropdown in the taskbar of the environments window, you can select an environment as execution environment. That means that when you start a test case execution from Visual Studio, the test case will run on this test environment.

When you connect to an environment it will automatically be set as the execution environment.

Modifying and Removing the Test Environment

To modify or remove a Test Environment simply right click on the Environment name and select the desired action.

You will be navigated to the modification page where you can change the desired parameters. To confirm the changes press the Save button. To cancel any changes click the back button.

There will not be an additional confirmation displayed upon pressing the Delete button

Remote Directory Connection string

The format of the remote directory connection string is as follows: "{\\computername\sharename}"::{username}::{password} For a azure file share, this could look for example like this: "\\mystorageaccount.file.core.windows.net\myfileshare"::AZURE\mystorageaccount::ctzMq410TV3wS7upTBcunJTDLEJwMAZuFPfr0mrrA08==

This remote directory connection string will be used by the SystemHelpers.SetUpRemoteDirectory method to map this remote directory on the SUT. You can also map the remote directory on your local PC with the BaseModelHelpers.MapRemoteDirectoryOnHost to make it available to the test case.

Last updated