Exam >
On this page

Cookies

To specify cookies the cookies attribute may be used to specify cookies for all cases and the case.cookies attribute to completely replace them for specific case.

Examples

cookies

Given


Client has cookie c1 = 111.
The following markup:
<e:get url="/mirror/headers" cookies="c1={{cookie}}, c2=2">
  <e:case desc="Case with default cookies">
    <e:expected> { "GET": "/mirror/headers", "Authorization": null, "Accept-Language": null, "cookies": {"c1": "111", "c2": "2"} } </e:expected>
  </e:case>
  <e:case desc="Case with custom cookies" cookies="c2 = 22">
    <e:expected> { "GET": "/mirror/headers", "Authorization": null, "Accept-Language": null, "cookies": {"c2": "22"} } </e:expected>
  </e:case>
</e:get>
will be rendered as:
GET /mirror/headers
Content-Type application/json
Cookies c1=111, c2=2
Use cases:
1) Case with default cookies
GET /mirror/headers HTTP/1.1
Cookies: c1=111, c2=2
20014ms
2) Case with custom cookies
GET /mirror/headers HTTP/1.1
Cookies: c2 = 22
2009ms