Generating Vigo Reports
Generating Vigo Reports in Selenium Webdriver will discuss in detail about generating execution status reports in selenium web driver.
Pre-requisites to set up the Vigo Reports:
- JDK should be installed in the machine.
- TestNG should be installed/added in the eclipse.
Steps to configure the Vigo Reports:
- Need to create an account in their official site. Once you create an account then you have to log into that account.
- Create a project.
- Download Vigo-TestNG jar from this link. (It might change while reading this blog. So, please download the latest jar file).
- Need to generate a Configuration file using command prompt. For this need to execute the below command where you want to create that file.
Java -jar Vigo-TestNG-xxx.jar -init (here ‘xxx’ mentions the version of Vigo-TestNG jar)
- Once the config file is generated, by default it will have two values called projectkey and repositoryDirectory. So, we need to give these two values to generate the reports. For projectkey; go to the projects and then click on edit icon of the project then we can see the project key. Copy and paste this value into config file. For repositoryDirectory; go to the eclipse and once you execute any sample testNG script then it will create a directory called ‘test-out’ in the project. Copy the path of this folder and paste in the config file.
{ “projectKey”: “502d97c9a94567GH59711966a3ec8d758”, “reportDirectory”: “F:/TestProjWorkspace/Test1/test-output” }
- Now start the VigoBot-Testng using the below command.
Java -jar Vigo-TestNG-xxx.jar
- After Vigo Bot started, execute your automation suite using testNG, then the vigo bot will track the result on Vigo Report.
- Now log into your account and see the generated report.
Till now we have seen theory, now will write one sample program and we will execute the same and then see the output html vigo report.
- Below is the sample program
import org.testng.Assert; import org.testng.annotations.Test; public class VigoReportDemo { @Test public void firstTest() { Assert.assertEquals("Krishna", "Sakinala","Assert failed as both the values are not Equal"); } @Test public void secondTest() { Assert.assertEquals("Krishna", "Krishna"); System.out.println("Both the values matched"); } @Test public void thirdTest() { Assert.assertTrue(1 > 0,"Assert failed as condition is wrong"); System.out.println("Condition is True"); } @Test public void fourthTest() { Assert.assertFalse(1 > 0, "Assert failed as condition is wrong"); } }
- Now download the Vigo jar file and place in a particular folder.
- Now go to the folder where you saved the Vigo jar file and run the below command in the command prompt.
Java -jar Vigo-TestNG-0.0.4.jar -init
Then it will create a json file called “vigo.config.json”. If you open this file you can find two values called “projectKey” and “reportDirectory”. And both the values are empty. We need to give the values to these above things. Project key can be found when you click on edit icon of the project which we created in the vigo reports site. And Report Directory will be the test-output directory of the project which we created in the eclipse. If you write any sample testNg program and run the same, after completion of the execution just refresh the project folder then you can find the test-output folder. Need to copy the path of this folder and paste in the configuration json file for the reportDirectory.
- Then run the below command in the command prompt where we executed the 3rd step.
Java -jar Vigo-TestNG-0.0.4.jar
Once you hit enter for the above command, then it will ask for the test suite to execute.
- Then go to eclipse and execute the test suite using testng.xml file. Once the execution is completed then vigo report will write the status to your project which you created in the site in the form of builds. For each execution it will create separate build.
- Go to the project which is created in the vigo site. Then you can see the detailed reports as a separate build.This way we can generate the vigo reports for selenium scripts or suite.Please watch the YouTube video of this blog for better understanding.