Forum Discussion
captainfranz
12 years agoOccasional Contributor
Apologies for the delay in my reply, I didn't have time to come back to this problem until today.
I am aware of what you proposed, however an example would be extremely helpful. The documentation is very lacking on examples.
1. If I use the context, I am doing the following.
In the load test setup script:
In the test step script:
This fails with "java.lang.NullPointerException: Cannot invoke method size() on null object". So it appears this is not the right syntax, but it is what the documentation says.
2. If I use a property, I have used the following syntax to get a property value from a test step (and similarly to set a value):
However I am not able to set a property from the load test and successfully read it from the test step. Also, since property values can only be strings, I would have to convert from list to string and back. How do I convert back without writing my own parser? What if the object I need to pass is a complex one and not just a simple list?
3. Is the execution of the load test setup script triggered by a different "play" button (just above the script) than the entire load test (at the top of the screen). It appears so. This is weird. I would expect that when I trigger the load test, the setup script executes first, then the steps of the load test are executed.
I am aware of what you proposed, however an example would be extremely helpful. The documentation is very lacking on examples.
1. If I use the context, I am doing the following.
In the load test setup script:
context.myList = [1, 2, 3]
In the test step script:
listSize = context.LoadTestContext.myList.size()
This fails with "java.lang.NullPointerException: Cannot invoke method size() on null object". So it appears this is not the right syntax, but it is what the documentation says.
2. If I use a property, I have used the following syntax to get a property value from a test step (and similarly to set a value):
testRunner.getTestCase().getTestSuite().getPropertyValue("myList")However I am not able to set a property from the load test and successfully read it from the test step. Also, since property values can only be strings, I would have to convert from list to string and back. How do I convert back without writing my own parser? What if the object I need to pass is a complex one and not just a simple list?
3. Is the execution of the load test setup script triggered by a different "play" button (just above the script) than the entire load test (at the top of the screen). It appears so. This is weird. I would expect that when I trigger the load test, the setup script executes first, then the steps of the load test are executed.