HomeSUGGESTIONS & FEATURE REQUESTS

Recommend a feature for future StresStimulus versions.

parameterization and comma delimited parameters Messages in this topic - RSS

Danny Krouk
Danny Krouk
Posts: 5


5/25/2011
Danny Krouk
Danny Krouk
Posts: 5
***Completed in v.0.9 update***
I'm digging the ability to parameterize the requests based on a csv. 
 
However, I've got a REST endpoint that has one parameter that requires a comma delimited list.  Like:
http://<url>/?
param1=<value1>
param2={"<nameA>":<valueA>,"<nameB>":<valueB>}
param3=<value3>
...
 
Unfortunately, StresStimulus wants to interpret these commas as field separators.  I've tried html encoding them commas like:
param2={"<nameA>":<valueA>%2C"<nameB>":<valueB>}
 
But, that just creates a big old mess because StressStimulus seems to want to encode the encoded commas. 
 
Is there a strategy to deal with this?
 
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


5/25/2011
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Hi Danny,

Good point. There are 2 issues with StresStimulus parsing of .csv files:



  • The coma character is reserved for a field separator, and cannot be used within values.

  • No support for URL encoding.



Thanks to your post, we will fix both of them in the next version that is coming in a few weeks. The following conventions will be used:



  • To include a coma character within values, surround it with the double-quotes.

  • Using URL encoding %XX, where XX is a hexadecimal number, will be supported.

  • In rare cases when %XX should be interpreted as a 3-character string, URL-encode percent character, so the string will look like %25XX



Do you think this is the right approach?
 
Thanks,
 
-Vadim
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


5/25/2011
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
I just thought about temporary workaround that might work for you until the next version is out.

1. In .csv replace the coma characters used within values, with any other character, let say ”|”
2. Add csv file to StresStimulus
3. Manually edit the Data Source grid and replace ”|” with “,”

This should do the trick for the time being if you have not too many records.


Cheers,

-Vadim

0 link
Danny Krouk
Danny Krouk
Posts: 5


5/25/2011
Danny Krouk
Danny Krouk
Posts: 5
Hi Vadim,
 
Thanks for the swift reply.  I think your approaches make a lot of sense.  EIther the ability to escape the comma character or the ability to encode the content myself would be useful.  :-)
 
Good thought on the interim workaround. 
 
Many thanks,
 
Danny

Vadim Kleyzit said:
Hi Danny,

Good point. There are 2 issues with StresStimulus parsing of .csv files:



  • The coma character is reserved for a field separator, and cannot be used within values.

  • No support for URL encoding.



Thanks to your post, we will fix both of them in the next version that is coming in a few weeks. The following conventions will be used:



  • To include a coma character within values, surround it with the double-quotes.

  • Using URL encoding %XX, where XX is a hexadecimal number, will be supported.

  • In rare cases when %XX should be interpreted as a 3-character string, URL-encode percent character, so the string will look like %25XX



Do you think this is the right approach?
 
Thanks,
 
-Vadim

0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


5/25/2011
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
You're welcome, Danny,
 
-Vadim
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


6/21/2011
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Danny,
Wanted to let you know that in v0.9 we added

  • Ability to use the coma character within values.

  • Support for URL encoding.


Thanks for your suggestion!
 
-Vadim
 
0 link
Danny Krouk
Danny Krouk
Posts: 5


6/28/2011
Danny Krouk
Danny Krouk
Posts: 5
Awesome!  The URL encoding works great!
 
I had a problem getting the comma character to work.   Could be my failure to understand. 
 
My encoded file begins like this:
 
bbox
6185556.59828594%2C2270927.74742652%2C6278569.03092713%2C2319915.52074446
<more lines>
 
It works like a champ.
 
When I do something similar with double-quoted commas:
 
bbox
6185556.59828594","2270927.74742652","6278569.03092713","2319915.52074446
<more lines>
 
I get the following error message when adding the data source:
 
"Error Details: Unmatching number of fields.  Expected 1 but received 2  Line 2"
 
I don't really know why StresStimulus would see two fields.  I would guess that it would see either one or four.  At any rate, have I misunderstood how to escape the commas?
 
Thanks very much.  This is a very nice enhancement.  Makes it much easier for me to use with the kinds of applications I need to test!


Vadim Kleyzit said:
Danny,
Wanted to let you know that in v0.9 we added

  • Ability to use the coma character within values.

  • Support for URL encoding.


Thanks for your suggestion!
 
-Vadim
 

0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


6/28/2011
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Hi Danny,

You are right. The issue was in failing to handle correctly multiple commas.  It will be fixed in the build scheduled for release this week.

Thanks for reporting it!

-Vadim
0 link
Danny Krouk
Danny Krouk
Posts: 5


6/28/2011
Danny Krouk
Danny Krouk
Posts: 5
Makes sense.  Thanks for fixing it! :-)
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


6/29/2011
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Hi Danny,

Wanted to let you know that the issue with multiple commas is resolved in the new version that we released today.

Cheers,
-Vadim
0 link
Danny Krouk
Danny Krouk
Posts: 5


7/2/2011
Danny Krouk
Danny Krouk
Posts: 5
Nicely done!  Works great.   Thanks very much.
 
If you are in the US, like me, enjoy the upcoming holiday weekend. :-)
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


7/2/2011
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Thank you. Have a great 4th of July Weekend too!
0 link






Copyright © 2024 Stimulus Technology