Forum Discussion

SebastianJ's avatar
SebastianJ
New Contributor
11 years ago

[Res] Execute DataGen Script on each DataSource Loop

Hello there,

I have a test case that looks like this:

-Test Steps
--DataSource
--DataGen
--REST Request
--DataSource Loop (DataSource --> REST Request)

However when I run the Test Case, the DataSource will loop, but the Datagen value will only be generated once and the same value is used for each loop iteration.
How can I make the DataGen script execute to return a new value on each loop iteration?
  • Hi,

    Try making your DataGen the Target Step in the DataSource Loop. Otherwise, the DataGen TestStep will only run once, not during the loop.

    Regards,

    Giscard
    SmartBear Support
  • SebastianJ's avatar
    SebastianJ
    New Contributor
    Thank you Giscard, that worked perfectly.

    All I had to do was modify (in bold):

    -Test Steps
    --DataSource
    --DataGen
    --REST Request
    --DataSource Loop (DataSource --> DataGen)