Applies to TestLeft 2.42, last modified on December 11, 2017

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 and supports a vast majority of the applications and technologies supported by TestComplete.

Creating a Test

You create TestLeft tests in Microsoft Visual Studio 2013, 2015 or 2017. Your TestLeft project must target .NET Framework version 4.5. or later.

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 panel that the TestLeft installer adds to Visual Studio.

The panel 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. The service is also included in the latest versions of TestExecute and TestComplete.

The service is also needed for exploring the applications, window and controls existing on your computer. The information on objects, methods and properties that the TestLeft UI Spy panel displays is provided by the service.

By default, the service works on the port 2377 (UI Spy implies the services uses this port). You may change the port number, but in this case UI Spy will not “see” objects in your system.

Prev     Next

See Also

Getting Started Tutorial