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.
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) }
Can you please help me?
Can you please provide an answer?
Is there is any possibility to add JMS Properties dynamically? Because in my case a number of these properties will be different, also a value of the key.
For eg., I will have a data source with the data loop and inside I will have a JMS Request. And during the first iteration
JMS Request will have 2 keys:
Key | Value |
Key1 | Value1 |
Key2 | Value2 |
and during the second iteration will have 3 keys:
Key | Value |
Key3 | Value3 |
Key4 | Value4 |
Key5 | Value5 |
and so on.
In some cases, JMS Request might have 0 keys.
I'm searching for a solution for this kind case.
@qazwsx ,
Can you please refer the below script?
https://github.com/nmrao/soapUIGroovyScripts/edit/master/groovy/jms/SetJMSProperties.groovy
I'm getting this error:
groovy.lang.MissingPropertyException: No such property: httpRequest for class: com.eviware.soapui.impl.wsdl.teststeps.JMSTestStep error at line: 18
@qazwsx ,
Difficult to say without more information.
Can you please post the result of below statements?
log.info step.metaClass log.info step.metaClass.methods*.name
Subject | Author | Latest Post |
---|---|---|