Setting up Testsigma Agent on your local Windows PC


Introduction

Once you have created a test case containing a number of test steps for execution, we can move onto setting up an execution environment.

We may choose any of the available execution models such as Testsigma Lab, Hybrid, Sauce Labs or BrowserStack.


For Hybrid Model, we need to configure a local machine to execute the tests. We can do that by setting up and executing the Testsigma Agent on the machine. The Agent will do the required configuration, avoid the hassle of numerous configuration for end-users and allow us to concentrate on managing the tests alone.


We assume that you have already created a Hybrid Execution on Testsigma website before configuring your local machine. If not, please refer to this article for a detailed guide on creating a Hybrid Execution - How to Create a Hybrid Execution for running Tests on Local Machine?

After creating an Execution, come back to this article for setting up the local machine for Hybrid Execution.


Below article explains the process of setting up your local machine for Hybrid Execution by configuring the Testsigma Agent Application.


NOTE: THE BELOW APPROACH HAS BEEN DEPRECATED NOW.

Please follow this article if you are trying to setup the Testsigma Agent for the first time - Quick setup guide - Setup TestSigma Agent on your device for Hybrid Test Execution(WIndows/Mac/Linux)


Prerequisites


1. Java Run-time Environment(JRE) or Java Development Environment(JDK)

To install Java Run-time Environment(JRE), you can download the latest version of JRE executable from Oracle here. The executable installer will take care of the installation.

Note: JRE version 7 or 8 is recommended to avoid compatibility issues.


2. Environment variables for Java

Once the JRE is downloaded and installed, you need to

  • set the JRE_HOME environment variable to the directory where java is installed.
  • set the Path environment variable to the bin folder containing the java executable(bin folder inside JRE or JDK folder).

Here's a detailed article on setting up the Environment variables for Java in Windows/Mac/Linux - How do I set or change the PATH system variable?



Setting up the Agent


(I) Add Browser drivers for Testsigma agent

(II) Starting Apache Tomcat Server

(III) Deploying Testsigma agent

(IV) Registering Testsigma Agent


(I) Add Browser drivers for Testsigma


Now that we have confirmed that Java is installed and working, we can move on to adding the Browser drivers for the Testsigma agent and later configuring the agent itself.


1. Download the zip file for Testsigma Agent Driver files from the following link.


Browser Drivers 32bit | 64bit


2. Create a folder named 'Testsigma' inside your 'Documents' folder. Now again, create a folder named 'drivers' inside the recently created 'Testsigma' Folder.


3.  Extract the contents of the downloaded zip inside the drivers folder. If everything went well, the 'drivers' folder should contain folders such as googlechrome, firefox, edge, IE e.t.c



(II) Starting Apache Tomcat Server

We need to download Apache Tomcat to deploy the Testsigma Agent. (Why do I need Apache Tomcat for Testsigma Agent?)

You can download Apache Tomcat from here - Apache Tomcat Download page.


1.) Download the zip file specific to your OS architecture(32 bit or 64 bit). Let us assume you have downloaded the file ‘apache-tomcat-xxxx.zip’(xxx replaces the version name).


2.) From the zip file, extract the folder named ‘apache-tomcat-xxxx' to the Testsigma folder we created earlier. The contents of Apache folder is as shown below:



3.) Go to ‘bin’ directory inside the Apache Tomcat working directory. You would see 2 files named ‘startup.bat’ and ‘shutdown.bat’ there along with many other files.

4.) Open a ‘Command Prompt(CMD)’ window and navigate to the above-specified bin directory i.e. ‘C:\Users\[your_username]\Documents\Testsigma\apache-tomcat-[version]\bin’ using the cd command.




5.) We need to run the ‘startup.bat’ file to start the server. Type ‘startup.bat’ and press ‘Enter’ key. Another window will open up and the Apache server will start running. Keep both the command prompt windows open and wait for the message “server startup in X ms” in the newly opened window.



6.) After that, open your web browser ex: Chrome, firefox, IE etc and go to address - http://localhost:8080/


7.) Apache server webpage would load up as given below:



This confirms that Apache server is running successfully.


(III) Deploying Testsigma Agent


You can download the Testsigma agent file from here - Testsigma Agent


For starting the Testsigma Agent, we need to - "place the Agent.war file inside WebApps folder inside apache-tomcat-x.x.xx".

Delete the existing files in that folder and copy the Agent.war file. At the end, there should be only the Agent.war file and agent folder(optional) in the WebApps folder.


Note: It is advised to stop the Apache Tomcat server before adding the agent file to the Apache Tomcat working directory. You can stop the server by running the shutdown script located in the bin directory in a manner similar to running the startup script. Run the shutdown.bat file to stop the server.




Once that is copied, we can start the server again by running the 'startup.bat' file. Now, the Apache server is hosting the Testsigma Agent web application which was contained in the agent.war file.


(IV) Registering the Agent


1. Open a web browser window and go to URL http://localhost:8080/agent to open the web application. If everything went well, you would get a web page similar to the one given below:



2. Click on the register agent link and enter the following details for registering and authorizing the agent.

  • Server URL: Testsigma Application URL (https://app.testsigma.com). No modification required unless you are using Testsigma private-cloud setup.
  • Username: Username of your Testsigma Account
  • Password: Password for your Testsigma Account

Click on the Register button to register the Agent. We will get a notification saying that the Agent has been registered successfully.


3. After successful registration, click on the Executions link on the left navigation menu to go to the Executions page. There won't be any Execution listed there if we have not started or scheduled any Hybrid Executions.



However, your local machine is now configured and ready to accept communication from Testsigma App Website.


4. Now, go to the Testsigma website and start execution of the recently created Hybrid Execution.


5. After starting the execution in Testsigma App on the website, come back to the Testsigma Agent page on the local machine. 


6. Go to Register page and register once again to update. Click on the Executions link. Now you will be able to see the Execution on the Executions page.


You have successfully configured your machine to run Tests locally. The Agent server will wait for the request from Testsigma Website App and the tests would start running in a few moments on our local machine.


Final Steps


Once the tests have been completed, you may close the web browser and shut down the Agent server by running the shutdown script located in the bin directory in a manner similar to running the startup script. Run the shutdown.bat file to stop the server.