Forum Discussion

ruhirm's avatar
ruhirm
Occasional Contributor
9 months ago

Re: ReadyAPI as a client of server sent events

Hi all, I second richie's thought.  I am stuck at SSE with ReadyAPI. It has been 4 years and still we do not have support on this. I wrote to them and they sent me this same post that I had read be...
  • nmrao's avatar
    9 months ago

    Have you tried adding either of below if it is REST or HTTP SSE service which you wanted to listen to?

    • REST Request test step
    • HTTP Request test step

    Once you add the desired step,and run it. In the raw tab, you would see the response (data) from server.

    If you need that response and process it further, no need to use any third party java libraries like this thread says , just do below:

    • add a groovy script test step

    log.info context.response

    One would see the log with response.

    You will have a hold of data which you need and act further as needed.

    For example:

    Data from the server / raw tab shows:

    Below code would filter the lines which has data and just get values say Message1, Message 2 etc

    def lines = context.response.split('\n')
    lines.findAll{it.contains('data')}.each {log.info it.replace('data:','')}