Forum Discussion

M_McDonald's avatar
M_McDonald
Super Contributor
15 years ago

Reset DataSource during a load test

Hi -

I am running a load test (single-thread) for a test case using a DataSource. I have turned off "Restart On Run" so that every row gets utilized, but I want to run the test case indefinitely. How can I reset the DataSource when it runs out of data?

Thanks.

3 Replies

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    I have tried adding a Groovy script step at the end of the test case like so:

    def ds = testRunner.testCase.getTestStepByName("Test Data")

    if (ds.getCurrentRow() == ds.getEndRow()) {
    log.info "Resetting test data source."
    ds.setRestartOnRun(true)
    ds.prepare(testRunner, context)
    } else {
    ds.setRestartOnRun(false)
    }


    This seems to work when I run the test case manually, but not when running a load test.
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    OK, I found the answer, turned on 'Restart Shared' and the load test keeps running.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    you've find the correct setting, sorry for not helping you on this

    regards!

    /Ole
    eviware.com