The value of order_contents is passed from a CSV file defined in scala file. order_contents in the CSV file is defined as "read( classpath:data/XML-Order.txt )" XML-Order.txt contains a string that is in XML format. Due to some limitations, I want to read it as string. :)
Feature: checkOrder
Background:
Given url getOrder.URL
* def contents = __gatling.order_contents
@checkOrder
Scenario: checkOrder
* string orderContents = contents
* print orderContents
When running, the print statement shows only read( classpath:data/XML-Order.txt ) as a string but not the contents of the string
BUT By hardcoding the path, it will achieve the result as what I have expected.
Feature: checkOrder
Background:
Given url getOrder.URL
* def contents = __gatling.order_contents
@checkOrder
Scenario: checkOrder
* string orderContents = read( classpath:data/XML-Order.txt )
* print orderContents
When running, the print statement will shows the XML string that is in XML-Order.txt file.
Also tried to do this
* def test = <contents>
* string value = test
But I am getting the below error when printing org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 24; XML document structures must start and end within the same entity.
But I want to implement a more dynamic way of defining the data via CSV file. Any help is appreciated.