Forum Discussion
7 Replies
Sort By
- grussellContributorWhy do you want to dulicate them? Is it just so they can all access the same data? If so then just use project or test suite properties which can be accessed by all (chidren) test cases.
- AndyHughesRegular ContributorThis would be good but what I want to do is output these properties in a load test in LOADUI, but in LOADUI I can only output test case properties as opposed to test suite properties.
- deepesh_jainFrequent ContributorYou can use setup script at a test suite level. So when you kick off the execution from a test suite, it can read the properties and set all the children test cases with those properties. Does that work?
- AndyHughesRegular ContributorHaha. It might do. But I'm afraid you're beyond my knowledge there. Unless you have time to explain more.?
- deepesh_jainFrequent ContributorOkay. Here you go for the long answer:
Every Test Suite and test case has something called setup script and tear down script. Both are groovy scripts which as the name suggests are run before and after the running of test suite/case respectively. If you open test suite by double clicking it, look for "setup" right above where you would get log. The editable area is too less so you will have to expand it. This setup script on a test suite level will can set properties at all 400 test cases level from a for loop since all these test cases would probably be under this same test suite. Does that make more sense?
Regards,
Deepesh - AndyHughesRegular ContributorI don't want to set properties for a test case (which I think is what you are describing). I want to export the value of a test case property after the test case is run.
Essentially I have 2 properties at test case level, one called 'Request' and one called 'Response'. They are populated by a property transfer, the source for them is the test case 'request' and 'response' respectively.
These test case properties are output in loadui. But the contents is obviously different for each test case.
All I want to do is to make it so that each test case has the properties 'Request' and 'Response' so that these variables can be 'populated' by the running of the test case. - deepesh_jainFrequent ContributorI am assuming both these properties are XML's. Once again as earlier, you can access the properties themselves from groovy script like below:
pvalue = testRunner.testCase.getPropertyValue("Property_Name");
You can name your test cases in an array like fashion and than call a for loop to pass these properties to the test cases.
Regards,
Deepesh Jain