cancel
Showing results for 
Search instead for 
Did you mean: 

how to send request response to readyapi report using groovy

SOLVED
Highlighted
Occasional Contributor

how to send request response to readyapi report using groovy

Hi Team,

 

I have a project which can be run on two endpoints and few request have different response.

 

Currently I'm executing Request and based on endpoint I've put assertion using groovy.

I've put log.info to print failure cause but I'm unable to write log.info into final junit type report, i'm only getting like below:

----------------- Messages ------------------------------
Assertion failed:

assert false


error at line: 46

how can I write requets and response in report or log.info in final report?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Contributor

Re: how to send request response to readyapi report using groovy

@nmrao  Thanks.


assert (X == 'X' ) : response

This did the job.

 

 

Thanks for help

 

Regards,

Vijay

View solution in original post

6 REPLIES 6
Highlighted
Community Manager

Re: how to send request response to readyapi report using groovy

@community, What can we suggest here?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Community Hero

Re: how to send request response to readyapi report using groovy

Assertion message will be part of the report, not the log.info


Regards,
Rao.
Highlighted
Occasional Contributor

Re: how to send request response to readyapi report using groovy

@nmrao  Thanks.


assert (X == 'X' ) : response

This did the job.

 

 

Thanks for help

 

Regards,

Vijay

View solution in original post

Highlighted
Community Hero

Re: how to send request response to readyapi report using groovy

Glad to know that it helped.


Regards,
Rao.
Highlighted
Occasional Contributor

Re: how to send request response to readyapi report using groovy

Can you please elaborate how to send ? 

Highlighted
Occasional Contributor

Re: how to send request response to readyapi report using groovy

 

 

 

response= testRunner.testCase.getTestStepByName("TestStep name").getPropertyValue("Response")
parsedResponse = new JsonSlurper().parseText(response)


def X=parsedResponse.TESTValue // value you need to assert or check


assert (X == '1234' ) : response    // this will post complete response in report

 

@prajakta 

Hope this help.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors