0

I am trying to access a rest-api from Tosca. For now I am using the "Communicate: Rest over HTTP"-module as described in the manual and in the webinar.

The communication has the following sequence:

  1. At the beginning, the client logs in to the server and receives a session-string in the data part of the packet.
  2. The server then expects this session-string as a cookie in each request.

My problem now is to put this new cookie (for example "session=somerandomdata") into the CookieResource.

Unfortunately the manual only applies to already existing CookieRecources.

My question is now whether it is possible to build a CookieRecource with this new cookie.

ms1028
  • 1
  • 1

1 Answers1

1

Whenever a Set-Cookie-Header is returned from the server, a new cookie resource is created.

Please check the manual here: https://support.tricentis.com/community/manuals_detail.do?lang=en&version=10.0.0&url=tbox/wse_tc_session_cookies.htm --> a new cookie resource is created with the name "myCookieResource". This cookie resource can later on be used in the "send" part.

Does this answer your question?

rolko
  • 51
  • 3
  • Unfortunately not. I get no cookie from the server (at least not in the Set-Cookie-Header). I only get a string in the data part of the package. From this string, Tosca needs to build a CookieResource. – ms1028 Nov 25 '16 at 09:02
  • What is the data part of the package? Tosca acts like a normal browser would, which means creating a cookie resource whenever there is a Set-Cookie-Header in the response from the server. Whenever you already send the cookie to the server, you will see no Set-Cookie-Header in the response. I usually clear all cookies in the browser and than check the location, which actually creates the cookies. This is what I than use in Tosca, which in most cases leads to the Cookie-Resource being filled properly. – rolko Nov 25 '16 at 12:29