Forum Discussion
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
Hi Anna,
It depends on what you're going to do next with the content of the file. DataSource steps are generally used with DataSource Loop step. JSON DataSource is useful when you have an array in JSON file (in RowPath node) and need to perform several test steps in a cycle for each array element (Column Paths). In Groovy DataSource you can manually generate each subsequent value - a script will be executed each iteration.
However, judging by the screenshot you want to use file content as body of the request. For this just add File Wait before the request and enter property expansion ${File Wait#fileContent} to Body field. To access the file content from Groovy script use
def fileContent = context.expand( '${File Wait#fileContent}' )
- amarcilla8 years agoOccasional Contributor
Hi Anton!
Can you cofirm, please if "file wait is proper of PRO SOAPUI version?
Thanks !!
Anna
- AntonE8 years agoSmartBear Alumni (Retired)
Hi, Anna.
No, this step was added only in Ready! API, but it should work with SoapUI Pro license and have lots of new features, so I suggest you give it a try.
- amarcilla8 years agoOccasional Contributor
Hi all !
Another question related:
We are using JSON files to load all the body parameters for a Test Suit with a lot of Test Steps. Most of this parameters are diferent for each Test Step, but they have some common parameters. And every time that some change is done, we should modify every single JSON.
So, We want to automate the JSON's preloading
We are considering to upload files with "file Wait", and before executing the test we want to predefine this common fields.
Which is the best way to do it? Some idea before starting?
Example, All bellow Test Cases have common parameters, but every once in a while we need to change them :
departure: "BCN",
arrival : "LGW",
departureDateTime : "2017-01-04",Thanks very much
Anna