Connecting to Test Engine

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

To run tests, TestLeft uses the TestComplete test engine. The test engine is an essential part of TestLeft, TestExecute or TestComplete. All these products use the same test engine. Tests created with TestLeft can work on any computer where TestLeft, TestExecute or TestComplete is installed.

In your TestLeft tests, you connect to the test engine and specify test commands the engine will execute (for example, launching the tested application, simulating user actions or posting data to the test log).

Initially, you may want to create and debug your TestLeft tests locally. In this case, you need to connect to the test engine on a local computer. To do this, use the LocalDriver object.

The code below illustrates how to connect to a local test engine:

C#

using SmartBear.TestLeft;

IDriver driver = new LocalDriver();

Visual Basic .NET

Imports SmartBear.TestLeft

Dim driver As New LocalDriver()

Java

import com.smartbear.testleft.Driver;
import com.smartbear.testleft.LocalDriver;

Driver driver = new LocalDriver();

Afterwards, you may want to run TestLeft tests on remote computers. In this case, you will have to connect to the test engine on the remote computers. To do this, use the RemoteDriver object.

The code below shows how to connect to a remote test engine:

C#

using SmartBear.TestLeft;

IDriver driver = new RemoteDriver("myHost", "user1", "pass1");

Visual Basic .NET

Imports SmartBear.TestLeft

Dim driver As New RemoteDriver("myHost", "user1", "pass1")

Java

import com.smartbear.testleft.Driver;
import com.smartbear.testleft.RemoteDriver;

Driver driver = new RemoteDriver("myHost", "user1", "pass1");

To learn how to create and use the LocalDriver and RemoteDriver objects, see About Driver Objects.

For Visual Studio Users: If you created your project using the TestLeft MSTest Project, TestLeft NUnit Project, or TestLeft xUnit Project template, then you already have one instance of the LocalDriver object. In this case, there is no need to create a LocalDriver object manually. You can just use the Driver property instead, which represents a connection to the local test engine.

Requirements

  • The TestLeft RESTful service must be running on the local and remote computers.

    When you run tests, the TestLeft RESTful service starts automatically. However, when you are creating tests, you may need the service to be running so that you can explore the object hierarchy from TestLeft UI Spy:

    1. Launch the TestLeft test runner (<TestLeft>\Bin\TestExecute.exe).

      – or –

      Start the TestLeft UI Spy (<TestLeft>\Bin\SmartBear.TestLeft.UI.Spy.exe) and click Refresh Object Tree.

    2. It will start the service automatically.

    As an alternative, you can use the TestComplete service if it is installed on your computer. To start the service, launch TestComplete with the REST API plugin enabled:

    • Launch TestComplete.

    • In TestComplete, select File | Install Extensions from its main menu.

    • TestComplete will open the Install Extensions dialog. Make sure the REST API plugin is installed and enabled.

    You cannot have several services running at the same time on the same computer. Make sure that only one service is currently running. Otherwise, an error will occur.
  • Windows Firewall should be configured to allow communication between TestLeft and the test engine on the local or remote computer. See Configuring Windows Firewall.

See Also

Creating TestLeft Tests
About Driver Objects

Highlight search results