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.
The technological stack used to implement the solution is:
Programing language: Python
Testing Framework: pytest
Reporting Framework: Allure
HTTP Library: Requests
Why should we attach our IP address to the report?
- This is done mainly for debugging purposes - if the automation fails we can filter the logs in a centralized logging system like Amazon CloudWatch.
- 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
We will use this method to attach the IP to the allure report in case of test failure:
Now each failure will contain our public IP
Happy testing!
QA Automation Engineer | SDET | Manual Tester | QA | @Pfizer
3 年Do you know how attach screenshots in allure reports for behave framework?