Dynamically set JMS Properties from groovy code
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dynamically set JMS Properties from groovy code
Dears,
Can you please tell me if there is any way to set JMS Property from groovy code?
I tried different ways to find a solution but unfortunately, nothing is working.
I can't use for example something like this ${#TestCase#PROPERTY_NAME}, because the number of JMS properties might be different like also names of properties.
Can you please help me with this topic?
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I'm using SoapUI Pro.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you able to use datasource values in SubmitListener.beforeSubmit()?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@qazwsx ,
Can you quickly try with below change?
From:
def existingProperties = step.httpRequest.getJMSPropertiesConfig().getJMSProperties()
To
def existingProperties = ((com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStepWithProperties)step).httpRequest.getJMSPropertiesConfig().getJMSProperties()
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With this change I got this error:
groovy.lang.MissingPropertyException: No such property: httpRequest for class: com.eviware.soapui.impl.wsdl.teststeps.JMSTestStep error at line: 23
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you able to use datasource values in SubmitListener.beforeSubmit()?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think I will able to use it. Or at least I will try.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok. Try to put below code in SubmitListener.beforeSubmit
import com.eviware.soapui.config.JMSPropertyConfig //Assign your data from datasource into map below - have your logic; otherwise try with fixed data def map = [a: 'one', b:'two'] if ('JMSRequestReply' == submit.request.name) { def existingProperties = submit.request.getJMSPropertiesConfig().getJMSProperties() def newList = new ArrayList<JMSPropertyConfig>() map.each { key, value -> def jmsPropertyConfig = JMSPropertyConfig.Factory.newInstance() jmsPropertyConfig.setName(key) jmsPropertyConfig.setValue(value) newList.add(jmsPropertyConfig) } existingProperties.clear() existingProperties.addAll(newList) }
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you it's working. For now, I tried with static data, but it's working.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.

- « Previous
-
- 1
- 2
- Next »
- « Previous
-
- 1
- 2
- Next »