TestLeft - Basic Concepts

Applies to TestLeft 15.40, last modified on March 17, 2022

SmartBear TestLeft is an automated test framework for creating and running functional and UI tests for Windows desktop and Web applications. You can create tests in C#, Visual Basic .NET or in any other .NET language, and run them from CI systems like Jenkins, from Visual Studio Test Explorer, or in any other way.

TestLeft is built on the TestComplete engine (both of them have a similar object recognition engine) and it supports most applications and technologies supported by TestComplete.

Creating a Test

You create TestLeft tests in Microsoft Visual Studio 2013–2019. Your test project should work with the following .NET technologies:

.NET Framework ver. 4.5 - 4.8

– or –

.NET Core 3.0 - 3.1

– or –

.NET 5.0

Automated UI testing with TestLeft: TestLeft components in Visual Studio

Click the image to enlarge it.

Exploring the Application Hierarchy

You explore objects, methods, and properties with the TestLeft UI Spy tool. It comes as a panel that the TestLeft installer adds to Visual Studio and as a standalone application.

TestLeft UI Spy shows the applications running on the computer, the object hierarchy of these applications and object properties and methods.

You can select an object on screen to view its properties and methods. To select the object that is currently under the mouse cursor, use the Pick Object tool. To select an object while moving the mouse cursor in the application, use the Point and Fix tool.

Exploring object hierarchy with TestLeft

Click the image to enlarge it.

You can also locate objects in the hierarchy by highlighting appropriate interface elements in the application.

Writing Test Code

You write test code using interfaces, classes and methods provided by the SmartBear.TestLeft.dll assembly included in your project.

You can write code manually or you can command TestLeft to generate the needed code automatically:

Generating code for automated tests

Click the image to enlarge it.

In addition to the panel and assembly, the TestLeft installer also extends Visual Studio with pre-defined templates for creating MSTest-, NUnit- and xUnit.net-compatible test projects. These templates make creating TestLeft tests a lot easier. Your projects will automatically get —

  • A reference to the SmartBear.TestLeft library.

  • Links to the SmartBear.TestLeft namespaces at the beginning of your source file.

  • An automatically created Driver object (this is a core object that is used to exchange data with the test runner and performing other test-related actions).

  • An automatically created Log object for receiving custom messages.

In addition to the project templates, the TestLeft installer also adds templates for creating individual MSTest-, NUnit- and xUNit.net-based TestLeft tests.

After you have compiled a project based on the templates, you get a module that can be run with the MSTest, NUnit or xUnit.net unit testing framework that you already use in your company.

We recommend using these templates for your test projects. However, you can place your TestLeft code in any application, for example, in a console program or in a regular WinForms application. In this case, you will have to manually perform all the actions needed to create TestLeft tests.

After you write test code in Visual Studio, you can compile it into a DLL or executable.

Running Tests

After you compile your test code, you can run it in any way: from Visual Studio Test Explorer, from Jenkins or any other build automation tool, from the command line (if you compiled your code as an executable), from your MSTest or Unit test runner, from TestComplete, or in any other way.

When your test is running, it sends commands to the test runtime engine, which, in its turn, simulates user actions on the tested application:

Automated UI testing with TestLeft: Running tests

The test can send commands to the runtime engine that resides on your computer or on any other computer that has TestLeft installed and that is available in your network. Your test code can also send commands to remote instances of TestExecute and TestComplete (the latest versions of these products can accept commands from TestLeft).

About Web Service

TestLeft interacts with the test runner through a RESTful web service. This web service is part of TestLeft and installs automatically, when you install TestLeft.

TestLeft UI Spy uses the service for exposing applications, windows and controls existing in your computer. The service provides information on objects, methods and properties that TestLeft UI Spy shows.

To learn more about the web service, see TestLeft RESTful Web Service.


Prev     Next

See Also

Your First Test With TestLeft - .NET and .NET Core Tutorial

Highlight search results