Skip to content
ckeiner edited this page Jul 24, 2018 · 1 revision

General

The CSV (Comma-separated Values) format is a data format, which provides an easy way to define data. Like YAML, you can define Requests, Validations and Subrequests with CSV files.

Outline:


The first uncommented line of the CSV file is called the header of the file and defines, where which element is. This header states which row defines which value. The order, in which the headers are defined, is largely irrelevant. The single exceptions are variables.

Header Value Used with Type Default
Type A, XA, or S - A
Name String A, XA Action-<NumberOfAction>
Url String A, XA, S No
Method GET,HEAD, POST,PUT,DELETE,TRACE,OPTIONS A, XA GET
Parameters Parameters seperated by & A, XA No
ResponseCode Integer A, XA 200
XPath String A, XA No
RegExp String A, XA No
Text String A, XA No
Encoded Boolean A, XA false

Since most of these are self-explanatory or work like their counterpart in Yaml, this guide only explains the differences.

The Type defines, what kind of request is stated. There are three types of requests:

  • A defines an action. That means, it's a normal HTTP request.
  • XA defines a Xhr Subrequests. The subrequest gets appended to the last defined action.
  • S defines a static subrequest. The subrequest gets appended to the last defined action.

Parameters must be defined like this:

..., parameters, ...
..., param1=v_1&param2=v_2, ...

Therefore, pairs of parameters must be separated by a &. The name and the value of a single parameter must be separated by a =. To specify, whether or not parameters need to be encoded, the encoded keyword is used.

To extract an element for validation purposes, you can either use XPath or RegExp. Please note, that you cannot use multiple XPath/RegExp expressions in a single action and cannot combine both.

To validate the extracted element, the Keyword Text is used. However, the value of Text is interpreted as pattern. Thus, the validation method is a Matches Validator. Furthermore, the validation name is set to Validate <ActionName>. However, should Name not be mapped, the validation name will be an empty string.

For variables, you need to use a separated header for each variable, depending on the extraction method.

..., xpath1, ...
..., expression, ...

Variables starting with xpath extracts expression via XPath and stores the result.

..., regexp1, ...
..., pattern, ...

Variables starting with regexp matches pattern and stores the result. Please note, that in version 2.1.0 capturing groups do not work!

If expression or pattern is empty, the value of the variable does not get overwritten.

Notes:

  • You can use any string after xpath and regexprespectively.
  • Variables are always resolved at the end of the action, regardless of the order of the headers.
  • Variables are resolved in order from the left-most header to the right-most header. Therefore, should the header order be xpath-12, xpathFourth, xpath-title, a new value is assigned for xpath12 before xpathFourth is looked at. This means, should xpathFourth use xpath12 in it's extraction expression, then the newly extracted value of xpath12 is used.

Clone this wiki locally