Test Automation - How To Attach Public IP Adress to Allure report using Pytest and Requests

Test Automation - How To Attach Public IP Adress to Allure report using Pytest and Requests

Introduction

In this article, I will explain how to attach our public IP address to Allure report using Pytest and Requests the work on this project was developed together with Elias Shourosh.

link to the project.

The technological stack used to implement the solution is:

Programing languagePython

Testing Frameworkpytest

Reporting FrameworkAllure

HTTP Library: Requests

Why should we attach our IP address to the report?

  1. This is done mainly for debugging purposes - if the automation fails we can filter the logs in a centralized logging system like Amazon CloudWatch.
  2. The IP also helps to detect a machine while running a parallel run with multiple containers or VMs.

Implementing the Solution

We will write a simple function that will do a GET request and return the IP address from the following AWS service: https://checkip.amazonaws.com

No alt text provided for this image

We will use this method to attach the IP to the allure report in case of test failure:

No alt text provided for this image

Now each failure will contain our public IP

No alt text provided for this image

Happy testing!


Masud Rana

QA Automation Engineer | SDET | Manual Tester | QA | @Pfizer

3 年

Do you know how attach screenshots in allure reports for behave framework?

回复

要查看或添加评论,请登录

Nir Tal的更多文章

社区洞察

其他会员也浏览了