Extent report for rest assured- loggin request and response - automated-tests

I am having a rest assured cucumber framework. I have configured grasshopper7 extent report adaptor in runner class. On executing the test, report is generated without any request or response details. How to log the request and response details into extent report

Related

Retrieve Repsonse Code from the Request Object

I need to create a middleware app that provides an api and consumes two apis. I am currently taking data from API A and creating data to send to API B via the HttpFoundation Request class. However, before I take the response from API B and send it back to API A; I would like to make sure that the HTTP Status Code is 200.
I don't see the ability to check for the status code when using the Request class.

WSO2 API Manager : Request Header too Large

I have an API Manager that sends as-is Http headers to backend. However, when client sends a SAML Response XML to API Manager, Request Header too large error is thrown. Attached Screen shot.
Where can we change the configuration, so as to allow large headers.
Set the appropriate vlaue to maxHttpHeaderSize property in
<HOME>/repository/conf/tomcat/catalina-server.xml

B2B handling SOAP Message but there is no response

Dears,
I developed my first datapower b2b solution, it must handle soap messages, the sender is sending soap message and the b2b service must retrieve soap also.
and I did the following :
I created an external Profile ExternalParter_hub and internal Partner IntrenalPartner_hub.
I set the destination for IntrenalPartner_hub to soap web service as a back-end.
IntrenalPartner_hub I made the response type SOAP.
I created B2BGW service and i added the Profiles above and i created HTTP Front Side handler for it.
In the B2BGW service that i created , i used the Document Routing Preprocessor in Advanced tab and I set the xsl document to assign sender and reciever data.
I created MPGW service and routes to the B2BGW service.
I tested the service using soapui by calling MPGW url as endpoint,
the soapui response panel is empty and the header section tells me that everything is ok. When Opening debug probe it tells that the soap service returns success soap message...
but MPGW service doesn't recieves any response from B2BGW service!!
and B2B Transaction Viewer show that message result is success ??
what is the missing part !!!!
The B2BGW in DataPower can't return any Response data other than its own "signals", eg. AS2 MDN or ebMS receipts.
You have to either create/fetch your Response data in the MPGW "proxy" and attach that as the Result to the HTTP 200 Response from the B2BGW or use a url-open() (XSLT or GWS) in the Response (server-to-client) rule of the internal B2B partner.
So, there is no missing part, only a limitation in DataPower B2BGW...

Can't get authentication token from web api 2

I am new to Web Api 2. I am trying to build a project to explore token authorization. I created a new project in VS 2013 and selected the WebApi2 template and used Fiddler to emulate http requests. I didn't change anything in the template, just ran it as it was and tried to play with it with Fiddler. I successfully created a user by issuing request to /api/account/register but I can't login by issuing a POST request to the /Token endpoint. The request is:
http://localhost:YYYY/token?grant_type=password&password=admin123456&username=admin
(i also tried to pass the parameters as a json object in the request body).
I get back this:
{"error":"unsupported_grant_type"}
From other posts such as ASP.NET WEB API 2 OWIN Authentication unsuported grant_Type I learned that I needed to enable CORS for web api and at the token endpoint, but that hasn't worked for me.
Are you sure that you are sending POST request message and not GET?
If you simply go to the URL with query string (or open connection to this URL from your code) you are sending GET message by default. It's not what WebAPI with "/token" path is listening for.
If you are calling web service from same place, CORS is not needed. The error "unsupported_grant_type" could be in the format of the data you are passing server in post action.
Try sending with Content-Type application/x-www-form-urlencoded

Jmeter Web service Testing (HTTP Raw Request)

How to test web services which is written in PHP as "HTTP Raw Request" , I tried J meter Raw request Plugins, but i donno what to give in Request Data, And Data File Path ????
Kindly Suggest me to go further in Jmeter !!!!
SOAP Web Services are talking XML. REST Web Services are accept and reply JSON.
For XML-based Web Service you should be using
SOAP/XML-RPC Request to send a request itself
XPath Extractor - for correlation (extract dynamic values from response for re-using)
XPath Assertion - for checking that response is expected
For REST-based Web Service following components are quite good:
HTTP Request - to send requests
HTTP Header Manager - to hold Content-Type and any other headers
JSONPath Extractor (available via plugin) - for correlation
JSONPath Assertion - for testing
Perhaps Testing SOAP/REST Web Services Using JMeter guide can be a good place to start with.

Resources