Forum Discussion

YMaor's avatar
YMaor
New Contributor
15 years ago

init

what is the right way to run initialization process before running the tests themselves ?

there are two types of init that i want to run:
- creating random amount of data..
- running specific request, get the response, parse it, and get one element from it, for example, run rest that will create user, the rest returns the user id and status, i want to get the user id and use it in other request.

thanks.
  • For both of these, you can simply add them as steps within the test. Is there some reason you cannot do that?
  • YMaor's avatar
    YMaor
    New Contributor
    the only problem with it is that when doing a load test with soapui i don't want this steps to run in a loop like the others, i want it to run once and than the other tests...
  • Hello,

    In that case, you could put the initialization in it's own TestCase, and programatically run that TestCase from the LoadTest Setup Script:


    loadTestRunner.testCase.testSuite.testCases['InitTestCase'].run( context.properties, false )


    Replace InitTestCase with the name of your TestCase containing the init stuff. Also make sure to place the init TestCase first in the TestSuite, so that it is run first when running the TestSuite. Hope this helps!

    Regards,
    Dain
    eviware.com