Forum Discussion

divman's avatar
divman
Contributor
12 years ago

[Res] How to get complete RawRequest data for REST step

Hi,

I need to take the request input details passed to a REST step which is available in the "Raw" tab of the "Request" panel. Can anyone help me how to get that as a whole. I tried with below query but i get some junk string.

log.info testRunner.testCase.testSteps["RESTReq1"].testRequest.response.rawRequestData

Output:
Fri Oct 10 13:22:28 EDT 2014:INFO:[B@159fb20

I need to take the below Raw request input as a whole.

POST https://<host> HTTP/1.1
Accept-Encoding: gzip,deflate
Api-Key: <AppKey>
User-Id: <user>
Accept: application/vnd.com.capitalone.api+v3+json
Content-Type: application/json
Content-Length: 69
Host: <host>
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

{
"accessRoleId":"4308111",
"roleAssignmentStatus":"Active"
}

2 Replies

  • The query which i used is working, but i need to get that as String itseems. i found this from other topic in this forum. The correct format is..

    new String(testRunner.testCase.testSteps["AssignRoleToUser_RS"].testRequest.response.rawRequestData)


    Thanks for your support.
  • Hi,

    Please try this instead:
    log.info testRunner.testCase.testSteps["RESTReq1"].testRequest.messageExchange.rawRequestData


    Regards,

    Giscard
    SmartBear Support