Search code examples
soapreportingkarate

Karate - How can we see the exact request and input parameters sent when the request in feature file is called from a file


Karate - How can we see the exact request and input parameters sent when the request is called from a file and input parameters are coming through CSV file

In the HTML report - at the given request step,whole of the request with input parameters is displayed if the request has been put in the feature file.

HTML Report:
**Test 49 : Given request**

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Add xmlns="http://tempuri.org/">
      <intA>2</intA>
      <intB>6</intB>
    </Add>
  </soap:Body>
</soap:Envelope>

whereas, if the request had been put into an XML file and then called by using the XML in the feature file then it does not display the whole of the request in the HTML report.

For Example- Feature File: Given request read('classpath:RequestFiles/AddRequest.xml')

HTML Report just displays the test step as: "Test 86 : When soap action 'http://tempuri.org/Add'"

Is anyone aware of the way to display the whole of request with input parameters if the request(in the feature file) is called from a XML file?


Solution

  • There is a simple way to put anything in what you refer to as the Doc String section of the report. Just print it.

    * print someVarYouReadFromAFile
    

    Also note that HTTP requests and responses will appear in the report by default, and most teams are fine with it. If you don't see this, there may be some other problem.

    Finally a word of advice. I see many teams focus too much on time on making the reports "pretty". I would focus more on the question "am I able to test more scenarios and detect failures ?".