Setting up Testsigma Agent on your local Mac/Linux machine


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 JAVA_HOME environment variable to the directory where java is installed(JRE or JDK folder)
  • set the Path environment variable to the 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 Agent


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


1. Download the zip file for Testsigma Agent Driver files from the following link. Download the zip file specific to your OS below:


Mac 32bit | 64bit

Linux 32bit | 64bit


2. Create a folder named 'testsigma' in your 'Documents' directory. Now again, create a folder named ‘drivers’ inside the 'testsigma' directory.


3. Extract the contents of the downloaded zip there. The resulting folder structure should be similar to the one given below:


(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 it for free from Apache Tomcat website here - Apache Tomcat Download page.


1. Download the tar.gz file specific to your OS architecture(32 bit or 64 bit). Let us assume you have downloaded the file ‘apache-tomcat-xxxx.tar.gz’(xxxx 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 Tomcat working directory is shown below:



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


4. Open a ‘Terminal’ window and navigate to the above-specified bin directory i.e. ‘~/Documents/Testsigma/apache-tomcat-xxxx/bin’ using the cd command.



5. We need to run the ‘startup.sh’ file to start the server. Type ‘./startup.sh’ and press ‘Enter’ key. The Apache server will start running now.


6. After that, open your web browser ex: Google Chrome, Safari etc and go to address

http://localhost:8080/


7. Apache server webpage would load up as shown 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.sh file to stop the server.


Once that is copied, we can start the server again by running the 'startup.sh' file. 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 if prompted for. 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 for Windows and shutdown.sh file for Mac/Linux to stop the server.