RequestBody, HttpRawRequest and ResponseBody in the run results for UFT API.
Question ID: 107143
0
0

I am testing REST services using UFT 11.50. After sending the request, HP test results viewer shows captured data. In it, 3 properties – RequestBody, HttpRawRequest and ResponseBody – are shown as links. Is there a way to show them as text in the run results viewer? Content type is set to application/xml. I tried with few other content types, but it did not change anything in run results viewer.

Marked as spam
Posted by (Questions: 45, Answers: 0)
Asked on October 10, 2016 1:53 pm
421 views
Answers (1)
0
Private answer

You can create a custom code to inject the items into the report. Below is example code which will have to be adjusted for your environment.

public void RESTActivityV215_OnAfterExecuteStepEvent(object sender, STActivityBaseEventArgs args)
{
//report the request and response in the results report Differently
this.RESTActivityV215.Report(''HTTP REQUEST'',(this.RESTActivityV215.HttpRawRequest.ToString()));
this.RESTActivityV215.Report(''REQUEST BODY'',(this.RESTActivityV215.PostBody.ToString()));

this.RESTActivityV215.Report(''HTTP RESPONSE'',(this.RESTActivityV215.HttpRawResponse.ToString()));
this.RESTActivityV215.Report(''RESPONSE BODY'',(this.RESTActivityV215.ResponseBody.ToString()));

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on October 10, 2016 1:55 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top