Python Forum
Using a value from one json file to another.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using a value from one json file to another.
#1
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  parse json field from csv file lebossejames 4 668 Nov-14-2023, 11:34 PM
Last Post: snippsat
  Python Script to convert Json to CSV file chvsnarayana 8 2,343 Apr-26-2023, 10:31 PM
Last Post: DeaD_EyE
  Loop through json file and reset values [SOLVED] AlphaInc 2 1,958 Apr-06-2023, 11:15 AM
Last Post: AlphaInc
  Converting a json file to a dataframe with rows and columns eyavuz21 13 4,160 Jan-29-2023, 03:59 PM
Last Post: eyavuz21
  validate large json file with millions of records in batches herobpv 3 1,216 Dec-10-2022, 10:36 PM
Last Post: bowlofred
  Writing to json file ebolisa 1 970 Jul-17-2022, 04:51 PM
Last Post: deanhystad
  Trying to parse only 3 key values from json file cubangt 8 3,334 Jul-16-2022, 02:05 PM
Last Post: deanhystad
  Initializing, reading and updating a large JSON file medatib531 0 1,722 Mar-10-2022, 07:58 PM
Last Post: medatib531
Question How do I skipkeys on json file read to python dictionary? BrandonKastning 3 1,829 Mar-08-2022, 09:34 PM
Last Post: BrandonKastning
  value null when update in json file 3lnyn0 6 3,071 Dec-30-2021, 05:52 PM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020