Giter Site home page Giter Site logo

Comments (4)

SeanLS avatar SeanLS commented on May 26, 2024 1

I will try your suggestion tomorrow and feedback to you. Adding this in the CSV docs section may help others as well should it work.

from jmeter-dotnet-dsl.

rabelenda avatar rabelenda commented on May 26, 2024

Hello, thank you for trying and asking about this and providing so well formatted report.

Currently the CsvDataSet element already sets allow quoted data to true. This was done to standarize the formatting of CSV files regardless if random order is required or not (random order uses Blazemeter plugin which contains Random CSV Data Set Config element, and such element does not provide a setting to disable such behavior).

In your case you can adapt the csv by enclosing with quotes and replacing each quote with double quotes (a standard CSV format for quoted values). Eg:

HeaderValue
"[{ ""keyValue1"" : ""dataValue1""}]
"[{ ""keyValue2"" : ""dataValue2""}]
"[{ ""keyValue3"" : ""dataValue3""}]

Do you think that with such workaround is still required to add support for the "unquoted" option? That would require extending the BM plugin to support the unquoted case)?

from jmeter-dotnet-dsl.

SeanLS avatar SeanLS commented on May 26, 2024

@rabelenda - While thinking about your suggestion, I think the Allow Quoted data should be configurable as your suggestion means that the payload is not conforming to the JSON standard. This requires re-working of any JSON data to have an invalid JSON payload which is means you are diverging from standards.

While I appreciate that you are trying to standardise things, sticking to the standards for a given language should be a priority.

Additional examples.... If you are posting XML, HTML, JS, etc directly you should have the ability to send the data verbatim for that given row in a CSV. Exactly like producer and consumer would act and form/produce/send the markup for each request.

(Extra info: Allow quoted data would be set to False in order to allow this to be processed and not the default of true as it is currently set to.)

from jmeter-dotnet-dsl.

rabelenda avatar rabelenda commented on May 26, 2024

Hello, thank you for your feedback.

Regarding the content not conforming with JSON standard, keep in mind that we are talking about a CSV file, and not a JSON file, so you should expect to do some transformations on your contents when copying one format inside another.

For instance, this JSON will not be parsed correctly regardless the allow quoted flag, and it will even not be parsed as you would expect for most of CSV parsers:

VAL
["val","test"]

Unless you escape it properly to be a CSV file you will get VAL=["val"

Same happens with other formats you describe as XML, HTML, JS, etc. CSV parsers usually split by the comma, unless the field starts with double quotes.

Other examples that will fail parsing:

{"field": "val, ue"}
<field tags="t1,t2">val</field>
<field>my, val</field>

You will always need to make sure that your "inner" format complies with CSV.

The easiest rule to make your format comply with CSV, is replacing each double quotes with two double quotes and add double quotes at the beginning and end of each value. This is the rule I applied to your example.

from jmeter-dotnet-dsl.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.