Forum Discussion

Suncrusher's avatar
Suncrusher
New Contributor
4 years ago

LoadTest - setup script - set properties

Hi,

 

I want to initialize a JSON database with some dynamic values before the load test really starts.

 

When accessing the properties I can't read the values. Here is what I have so far:

 

 

for (String key : loadTestRunner.getLoadTest().getTestCase().properties.keySet()) {
 	log.info("propertiesMap key: " + key);
 	log.info("Value: " +loadTestRunner.getLoadTest().getTestCase().properties[key]);
 }

 

 

This results in this output:

 

 

Tue Sep 28 15:39:00 CEST 2021: INFO: propertiesMap value: currentRow
Tue Sep 28 15:39:00 CEST 2021: INFO: Value: com.eviware.soapui.impl.wsdl.support.XmlBeansPropertiesTestPropertyHolder$UserSpecificPropertiesStepProperty@59c91ae5

 

 

What is this com.eviware.soapui.impl.wsdl.support.XmlBeansPropertiesTestPropertyHolder$UserSpecificPropertiesStepProperty?

How to get the value out of it?

 

  • Seems that this value can only be read but not changed. Via this code I could extract the value:

     

     def project = loadTestRunner.getLoadTest().getTestCase().getTestSuite().getProject();
     log.info("loadTestRunner - loadTest: " + loadTestRunner.getLoadTest().getTestCase().getLabel());
     for (String key : loadTestRunner.getLoadTest().getTestCase().properties.keySet()) {
     	log.info("propertiesMap value: " + key);
     	log.info("Value: " +loadTestRunner.getLoadTest().getTestCase().properties[key]);
     	def prop = loadTestRunner.getLoadTest().getTestCase().properties[key];
     	log.info("internal value: " + prop.getProperties()["value"]);
     }

     

    Here is a 10 years old version of this class: https://github.com/oysteing/soapui/blob/master/src/java/com/eviware/soapui/impl/wsdl/support/XmlBeansPropertiesTestPropertyHolder.java

  • Suncrusher's avatar
    Suncrusher
    New Contributor

    Seems that this value can only be read but not changed. Via this code I could extract the value:

     

     def project = loadTestRunner.getLoadTest().getTestCase().getTestSuite().getProject();
     log.info("loadTestRunner - loadTest: " + loadTestRunner.getLoadTest().getTestCase().getLabel());
     for (String key : loadTestRunner.getLoadTest().getTestCase().properties.keySet()) {
     	log.info("propertiesMap value: " + key);
     	log.info("Value: " +loadTestRunner.getLoadTest().getTestCase().properties[key]);
     	def prop = loadTestRunner.getLoadTest().getTestCase().properties[key];
     	log.info("internal value: " + prop.getProperties()["value"]);
     }

     

    Here is a 10 years old version of this class: https://github.com/oysteing/soapui/blob/master/src/java/com/eviware/soapui/impl/wsdl/support/XmlBeansPropertiesTestPropertyHolder.java