TestVagrant

How to Build Real-time Test Case Monitoring Dashboards?

How to build Real-time Test Case Monitoring dashboards?

Blog

How to Build Real-time Test Case Monitoring Dashboards?​

Inmy previous blog, We learned how we can monitor logs of our test cases in real-time by implementing ELK, and we were able to see the logs on Kibana.

In this blog, we will be looking at how we can represent the same data in a graphical format which will be very easy to understand and even a non-tech person will be able to read and understand.

To do this will take the help of Dashboards in Kibana.

Set Up:

To start, We need elasticsearch and kibana servers to be up and running. You can find out how we can start these servers in my previous blog here.

So now, we are aware that we need to ingest test cases data inside elasticsearch for indexing (refer to the previous blog). Now we will need to create a dashboard using the same data that we inserted in elasticsearch.

Since we already have ingested the data inside elasticsearch in my previous blog. Now we will directly have a look at how to visualize in the form of graphs, pie-charts, etc. So to do this navigate to the below link in the browser.

				
					http://localhost:5601/
				
			

Steps:

  1. Click on the hamburger menu and navigate to Visualize.

2. After clicking on Visualize, You will be able to see an option – Create visualization, click on it.

3. Next, There would be some set of visualization options, We will be selecting Aggregation based. (You can explore others as well).

4. Under Aggregation Basis, We will get a lot of options, these are the format in which we need the report to be visible like Graphs, Pie-chart, Vertical bar, Horizontal bar, etc.

5. You can select any one of them, we will select the Vertical bar for now.

6. Now we will select the index that we had created while creating the index pattern.

7. Upon selection of the type (index) Vertical bar will get added. But for now, It has all the set of statuses that we had pushed while ingesting the data via API like Pass, Fail, Skip.

In the below image, On the X-Axis you can see it is showing as ‘all’.

We now need to create separate vertical bars for separate status for now we have three statuses as Pass, Fail & Skip.

8. To get separate Vertical bars, Click on Add under buckets on the right-hand side and select the X-axis. Under Aggregation drop-down, Select Terms

9. Now under Field drop-down menu, Select status.keyword since we want our reports to show the X-axis on the basis of “Status”.

10. Click on Update.

We can now see three separate vertical bars for statuses like Pass, Fail & Skip

11. Just click on save and head over to Dashboard (Click on the Hamburger menu and search for Dashboards).

12. There would be two options Create & Add from the library. Click on Add from the library and our saved visual will be populated select it.

That’s it. Now just click on save on the dashboard and we are done.

Now, whenever there will be a new test case ingested these counts and charts will also get updated based on the respective statuses.

Bonus

If you want to change the colors, Again click on “Add” under bucket → Split series → Select an aggregation as “Terms” → Field as “status.keyword” → Click on Update → Select each status from the below image and change color as per your preference.

Finally, You can also add other types of visualization following the same process and add them to the dashboard.

Usage

On a Real-time basis, you can add the data ingestion part in your listeners class under onTestSuccess, onTestFailure, onTestSkipped.

Other use cases

Alerts: Alerts can be configured on the basis of failure count goes below a certain number it should send an alert.

References

Share This Article

Other Related Articles

Scroll to Top