Ramsiya
12 months agoOccasional Contributor
Readyapi
Is it possible to include more than one data source in a single request? For instance, I would like to execute the Guid data source to change the tracking ID, and I need Excel to read the values
Hi,
There's plenty of examples of nested datasources on this forum. Here's one... https://community.smartbear.com/t5/ReadyAPI-Questions/Nested-datasourceloop/m-p/238724
Hey Ramsiya
I've never tried - the steps in a test run sequentially so strictly speaking I'm guessing you could have multiple datasources in the sequence before your executable test step - i.e. see as follows:
-TestSuite
--TestCase
----DataSource1 (read values from Excel)
----DataSource2 (GUID generator)
----Executable Step (REST Request?)
The above would work as the steps execute sequentially
I've just thought you might be looping your testcase (if you are using looping (and if you're reading from an Excel datasource then I'm guessing you are) and at first I was doubtful whether it would work - but after thinking I still think it would work fine with looping as long as you specified the first DataSource (DataSource1) as the LoopStep's DataSource.
If I understand correctly (and I could be wrong) and are using the GUID datasource to create GUID values and you want to read values from an Excel spreadsheet to populate your executable test step - then instead of having the GUID Generator datasource - you could use the dynamic snippet of the following:
${=java.util.UUID.randomUUID()}
if you have rows of data in a spreadsheet you could add this snippet in as another value for each row in your spreadsheet
This Java snippet dynamically generates type4 GUIDs/UUID values when processed by ReadyAPI.
i.e. if I save this as a testcase property value and then within my request's payload for the specific json attribute I point to the testcase property and when executed - it generates a GUID/UUID in the request payload.
Cheers,
Rich