...
name | type | default | alternative option names |
---|
with-header | boolean | true | withheader |
quote-char | character | \" | quotechar |
delimiter | character | , | |
end-of-line-symbols | string | \r\n | endoflinesymbols, end-of-line, eol-symbols |
When you pass the csv-config option 'with-header' with value 'false', the request will assume that the csv does not contain headers. It will then use a zero-based index as header.
Examples:
Code Block |
---|
title | Example of csv options |
---|
|
Scenario Outline: Combine different options
Given i call get "/rest/csv?withHeader=true&endOfLineSymbols=<eol>&delimiter=<delimiter>"eChar=<quoteChar>" with parameters:
| name | value | type |
| content-type | text/csv | header |
| end-of-line | <eol> | csv-config |
| delimiter | <delimiter> | csv-config |
| quoteChar | <quoteChar> | csv-config |
Then the response status should be 200
And the response entity "csv[1]" should contain "firstName" with value "John"
Examples:
| eol | delimiter | quoteChar |
| \r\n | ; | ' |
| \n | \| | # | |
Code Block |
---|
title | Example of CSV without headers |
---|
|
Scenario: Support line index for csv without headers
Given i call get "/rest/csv?withHeader=false" with parameters:
| name | value | type |
| content-type | text/csv | header |
| with-header | false | csv-config |
Then the response status should be 200
# csv[0]: check the first row of the response
# should contain "1": check the value of the second column in the row
And the response entity "csv[0]" should contain "1" with value "John"
And the response entity "csv[1]" should contain "1" with value "Bob" |