Forum Discussion
Hi, tgeliot
I suggest you try File Wait test step for reading your JSON file instead. It can wait for a file to appear, but more importantly it reads its content to fileContent property, which you later can address to in JSON DataSource.
File DataSource is useful when you have a file with easily separated property values (comma-separated, etc).
- amarcilla9 years agoOccasional Contributor
hi Anton Egorov
I'm trying to use File Wait test step for reading a JSON request
But don't know if I'm usinf well.
What do you mean by "it reads its content to fileContent property"?
Thanks & regards
Anna
- AntonE9 years ago
Alumni
Hi Anna,
File Wait test step has custom property fileContent. After the step is executed, this property will have the content of your file. You can access it in the following test steps using property expansion string - "${File Wait#fileContent}", where "File Wait" is the name of your File Wait step. In most cases Get Data item in context menu will generate this string for you.
In case of JSON DataSource you should choose your File Wait step in Source Step and fileContent in Source property (see http://readyapi.smartbear.com/structure/sources/json/start). You should run the test case at least once to be able to select nodes from the actual file, using buttons next to Row Path and Column Paths fields.
- amarcilla9 years agoOccasional Contributor
Hi Anton,
Thanks for your answers !!
Checking the link you send me. I realized that probably there is another way to do what I'm trying to do.Have a look the screenshot attached. I'm doing assertions with groovy scripts. What I need is to read a JSON file from the file system. The best way, it would be with "File Wait " or It might be better "Groovy Data Source"
Thanks in advance
Anna