Using a File datasource to read a file full of JSON (and then to use that JSON with a JSON datasourc
My testing situation involves reading a file that contains JSON and examining particular items within that file using a JSONpath expression. I have been writing Groovy scripts that use JSONSlurper to pull in the JSON, and then examining the resulting Map objects (not using JSONpath). It was suggested that I could use a Datasource test step of type "File" to read in the JSON, and then a subsequent Datasource test step of type "JSON" to examine it.
I created a File Datasource test step, and have successfully read in the file (I believe this because I see the file contents in the Data Log tab). But in the Properties for this test step, I see a property whose value is just a single squiggly bracket. I've tried putting different things in the "separator" box (a comma, nothing, left or right squiggly brackets, xxxx) to no avail.
Can anyone direct me on how to use these Datasource test steps this way, or should I just go back to typing Groovy scripts?
EDIT:
I tried to use a File datasource, and the resulting property just contained the last line of the file.
My file is not comma-separated or anything like that, it’s JSON. I couldn’t figure out any value to put in the “separator” box that would work.
Is this because I used File and not Filewait?