Tosca Integration using Commander
This documentation provides a detailed guide on seamlessly integrating Tosca with HyperExecute.
Pre-requisite:
- To run Tosca, ensure that you have all the required licences.
Integrate Tosca with HyperExecute
To Integrate Tosca with HyperExecute, follow the below mentioned steps:
Step 1: Go to the HyperExecute Dashboard. Click on the Projects.
Step 2: Click on the Setup a New Project button.
Step 3: Enter your Project Name. Click on Continue.
Step 4: Enter the License Details, i.e. Username and Password with which you want to execute your tests.
Step 5: Now select your Database Type. For the demo purpose, we are using Oracle. Choose how you want to establish the connection, i.e, via Connection Data or via Connection String, to access the common repository associated with your workspace. For demo purposes, we are selecting the Connection String. Enter the connection string for your database.
Enter the Workspace Details, i.e., Username (mandatory) and Password (optional), that you want to use for this project. Click on the Save button.
Step 6: Please wait for the discovered execution list to get populated. Now, select the desired tests that you want to execute, and then click on the Run button.
Step 7: Now set the total number of Concurrent Sessions that you want to run on HyperExecute and click on the Run button.
Step 8: Now go to the Jobs section and check the results.
Results will get updated in the Common Repository once execution is completed on HyperExecute. The live video of running tests can be viewed from the HyperExecute job-detaildashboard.
Integrate Tosca with HyperExecute using YAML
To Integrate Tosca with HyperExecute using YAML, follow the below mentioned steps:
Prerequisite
- Ensure that you have integrated Tosca with LambdaTest’s cloud-based Selenium Grid.
Step 1: Create an Execution List:
-
Go to the execution tab in your Tosca commander to create an execution list.
-
You can drag and drop test cases from the Test Cases tab to the execution list. In the example given below, the execution list is called LT.
Step 2: Create a TC-Shell Script:
- A TC-Shell script file usually has the extension .tcs, and it contains a sequence of TC-Shell commands in plain text to configure the steps to execute a Tosca test via command line. This script file is kept in the same folder where you have the actual Tosca project saved.
- Sample TC-Shell Script:
//script
jumptonode "/Execution/ExecutionLists/LT"
// reset actual log
task "clear log"
//start execution list
task run
//save results
save
- Click the arrow on the right side of the Execution tab to retrieve the node path used in jumptonode command.
- The node path is highlighted in the image below.
- Use the following command to execute this test via command line.
- TCShell.exe -workspace <Path to your tosca workspace file> -login <your email here> <your password here> "<Path to TC-Shell Script>"
Step 3: After configuring the TC-Shell Script, integrate it with HyperExecute. To do this:
-
Create a Hyperexecute YAML.
-
Download the Hyperexecute CLI Binary based on the OS you use:
The binary for Mac is unsigned. You might get a permission denied warning while executing on mac and linux machines. To allow permissions you can use the following command:
chmod u+x ./hyperexecute
.
Thus, you might see a security popup on whether to allow the execution of the tool or not. You can allow it from your System Preferences → Security & Privacy → General tab.
Sample Hyperexecute YAML file for TOSCA:
---
version: "0.1"
matrix:
os: [win]
runson: ${matrix.os}
retryOnFailure: true
maxRetries: 2
pre:
- PATH=%TRICENTIS_LICENSING_HOME%;%PATH% && ToscaLicenseConfiguration.exe connect-cloud -u <your_email_here> -p <your_password_here>
testSuites:
- TCShell.exe -workspace D:\foreman\<Project_Folder_Name>\Demo_Sample.tws -login <your email here> <your password here> "D:\foreman\<Path to TC-Shell Script>"
post:
- cat hyex_tosca.yml
uploadArtefacts:
- name: Logs
path:
- Demo_Sample/**
Each machine has a Tosca commander Client installed on HyperExecute. To successfully run your tests, your Tosca licenses must be pre-configured on the machine. To do so, we use the ToscaLicenseConfiguration.exe along with the connect-cloud parameter to validate the licenses as a pre-step before triggering the tests. The complete command is added under pre in the above sample.
- After configuring the YAML, execute it via terminal using the following command:
./hyperexecute --user undefined --key undefined --config RELATIVE_PATH_OF_YOUR_YAML_FILE
You have successfully integrated your Tricentis Tosca project with HyperExecute.