Forum Discussion

kvsspkumar's avatar
kvsspkumar
New Contributor
8 years ago
Solved

how to get JMS custom properties from response message to use in groovy or in property transfer

HI experts,

 

My use case is to retrieve JMS message from a topic and publish the message with all JMS properties to a queue. By browsing internet I found JMSMessageID can be retrieved like ${=context.testCase.testSteps["begin"].testRequest.response.messageReceive.JMSMessageID} in grrovey.

JMSMessageID is in-built property so it worked but I am interested in custom attributes also. "table" is custom property set to the response message. 

 

Can some one help me how to retrieve JMS custom attributes from response message in groovy or in property transfer

 

Thanks

Kumar

  • nmrao's avatar
    nmrao
    8 years ago
    Not a separate Groovy Script test step. Add Script Assertion for the same request where you get the response.

6 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Have you checked below in script assertion?

    log.info messageExchange.getResponseHeaders()
    • kvsspkumar's avatar
      kvsspkumar
      New Contributor

      Hi Rao,

       

      Thank you for your response. 

      Sorry I am not familiar with script assertion. When I ran the below statement as is in groovy it has thrown an error "no such property : messageExchange"

       

      Can you guide on assertions please 

       

      Thanks

      Kumar

      • nmrao's avatar
        nmrao
        Champion Level 3
        Not a separate Groovy Script test step. Add Script Assertion for the same request where you get the response.