Python Forum
Using a value from one json file to another. - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Using a value from one json file to another. (/thread-23435.html)



Using a value from one json file to another. - pyseeker - Dec-30-2019

Hello,

We are using Pytest for our API Automation and wanted to avoid hard coding throughout the test by dynamic insertion of the values for the fields.

So to be precise - a response of API-1 contains "id" fields with it's value. The response is written to a file.
However, the same "id" field is used in the payloads of API-2.

So, we wanted to use the value of API-1 "id" field to payload of API-2 route.
How can I make that happen ? Please suggest.