Honey Thakur
Honey Thakur

Reputation: 17

How to pick json playload from external file in jmeter?

How to pick json playload from external file in jmeter?

I Want to login with multiple users for that I need to add Json request. I need to pick json parameter/Json request from external file. Please let me know the process so that i can pick json parameter from external file.

Json request for example

{"username":"honey@est.com","password":"Phone@123","provider":"","access_token":""}

Upvotes: 0

Views: 948

Answers (1)

Dmitri T
Dmitri T

Reputation: 168157

  1. If you want to read a single line from a file - go for CSV Data Set Config or __StringFromFile() function

  2. If you want to read entire file - go for __FileToString() function

  3. If you have a folder with multiple JSON files and would like to iterate all of them - check out Directory Listing Config

  4. It's also possible to read a file using JMeter's HTTP Request sampler

    enter image description here

    this way you will be able to use Post-Processors to extract partial data if needed.

Upvotes: 1

Related Questions