Selenium

The folder TBox Automation Tools->Selenium in the Standard subset contains the following Modules:

These Modules allow you to start Selenium TestCases directly from Tosca Commander.

Supported formats

Tricentis Tosca supports the following formats:

  • NUnit or JUnit 4 TestCases

  • JUnit 5 TestCases

  • DLL and JAR files which contain Selenium 1 (RemoteControl)

  • Selenium 2 (WebDriver) TestCases

Supported test frameworks

Tricentis Tosca uses the following frameworks for your tests:

  • Selenium Java 3.9.1 to execute Selenium JUnit 4 tests

  • Selenium-Jupiter 3.4.0 to execute Selenium JUnit 5 tests

  • NUnit 2.6.4 to execute Selenium C# tests

Prerequisites

To run Selenium tests, you first need to copy the file Tricentis.Automation.AutomationTools.dll from the directory %TBOX_HOME% to the directory that contains your Selenium TestCases.

Start Selenium Server

This Module defines the connection properties for Selenium 1.

It has the following ModuleAttributes:

ModuleAttribute

Description

Selenium Server Path

Path to the Selenium server JAR file.

Tosca Commander automatically uses the ActionMode Select.

Selenium Port

Port for the Selenium server. By default, Tricentis Tosca opens the Selenium server via port 4444.

Tosca Commander automatically uses the ActionMode Select.

In this example, you define the following connection properties: 

  • The path to the Selenium server JAR file is D:\Selenium\selenium-server-standalone-2.44.0.jar.

  • The port is 450.

Start a Selenium server

Run Selenium Scripts

This Module starts Selenium scripts. After execution, you can view the result in the Loginfo column of the ExecutionEntry.

The Module has the following ModuleAttributes:

ModuleAttribute

Description

Path

Path to the DLL or JAR file that contains the TestMethods you want to execute.

TestClass

Class from the DLL or JAR file where the TestMethods are located.

TestMethod

TestMethods that you want to execute.

Report Directory

Location to store the test results.

This ModuleAttribute creates a time-stamped HTML result file for JUnit and an XML result file for NUnit in the specified directory with the file name ToscaSureFireReport_YearMonthDay_Time.

You can open these files directly from Tosca Commander via the Details viewer (see chapter "Open files you created during execution").

To run all tests within your DLL or JAR file, leave TestClass and TestMethod empty.

This example shows how to run a Selenium script.

The TestStep specifies the following:

  • The path to the JAR file is D:\Selenium\MixedSeleniumTests\SeleniumTestsExample.jar.

  • The file SeleniumTestsExample.jar contains multiple TestClasses. Tricentis Tosca should only use the TestClass InsuranceCalculator.

  • Tricentis Tosca should execute the TestMethods SelectCar and EnginePerformance.

  • Tricentis Tosca should save the report to "D:\Selenium\Selenium Reports\Mixed".

Run a Selenium script