ter Posts: 12
8/25/2014
|
We need to use a Dataset VU-Iter-Bound parameter in a request body. The original request body looked like this: ... {"Patient":{"PatientCode":"{076829e9-9774-4a3d-883c-20e7aa960488}"},"... We need the GUID to come from the Dataset for each VU and Iteration and so tried this: ... {"Patient":{"PatientCode":"{{{PatientCodeDataset.PATIENTCODE$VU-Iter-Bound}}}"},"... But the resulting requests look like this: ":{"Patient":{"PatientCode":"{{{PatientCodeDataset.PATIENTCODE$VU-Iter-Bound}}}"}," in other words, nothing no substitution took place. If I add a space between { and {{, ... {"Patient":{"PatientCode":"{ {{PatientCodeDataset.PATIENTCODE$VU-Iter-Bound}} }"},"... Stressstimulus will parametrize the requests: ... {"Patient":{"PatientCode":"{ 076829e9-9774-4a3d-883c-20e7aa960488 }"},"... but unfortunately, the request, with the additional space, is not valid in the eyes of the software we are testing (we cannot have the space in the request). Is there a workaround?
Thanks, Ter
|
|
0
link
|
Vadim @StresStimulus Administrator Posts: 583
8/26/2014
|
Ter, I can offer you the following workaround. Instead of parameterizing GUID, try parameterizing GUID in "curly braces". To so, in the dataset update all entries to be surrounded by "curly braces". After creating a parameter, the request will look like ... {"Patient":{"PatientCode":"{{PatientCodeDataset.PATIENTCODE$VU-Iter-Bound}}"},"... Does this make sense?
-Vadim
|
|
0
link
|
ter Posts: 12
8/26/2014
|
Hello Vadim: Thanks for the prompt follow up, as always. Using ... {"Patient":{"PatientCode":"{{PatientCodeDataset.PATIENTCODE$VU-Iter-Bound}}"},"... allows Stressstimulus to generate the GUIDs correctly: ":{"Patient":{"PatientCode":"000e1fe9-53bb-40c4-91f7-e87400f65684"}," but unfortunately not in the format accepted by our REST API. The API expects an object and therefore the GUID to be surrounded by curly braces. Do you have any other suggestion?
|
|
0
link
|
Vadim @StresStimulus Administrator Posts: 583
8/26/2014
|
Hello Ter, The workaround did not work because you missed the 1-st step:
in the dataset update all entries to be surrounded by "curly braces".
Here's the example: If the original data set looks like: 076829e9-9774-4a3d-883c-20e7aa960488 076829e9-9774-4a3d-883c-20e7aa960489 then you need to change it to:
{076829e9-9774-4a3d-883c-20e7aa960488} {076829e9-9774-4a3d-883c-20e7aa960489}
The change has to be done in the Dataset section. As a result, the parameterized request will keep its formatting.
Does this make sense?
-Vadim
|
|
0
link
|
ter Posts: 12
8/27/2014
|
I missed the part about modifying the dataset in your reply! Great workaround, although we have parts of the code that requires the use of the same GUID without the curly braces, per VU, per Iteration. Can this be an considered an enhancement request? But for now that workaround should work just fine. Thanks you.
|
|
0
link
|
Vadim @StresStimulus Administrator Posts: 583
8/27/2014
|
To solve the issue with the GUID used in two parts of the code, you can create a 2nd column in the dataset and store GUIDs with and without "curly braces." I created an enhancements request here . It will be developed in v 4.0. Thanks for pointing out this issue! As a token of appreciation for helping to make StresStimulus better, we reserved for you a free Weekly pass of StresStimulus Pro with 250 VUs. Just drop me a note at a time when you would want to start using it, and I will send you a serial number. Best, -Vadim
|
|
0
link
|
ter Posts: 12
8/27/2014
|
Another great suggestion that solves both issues. The enhancement request will be useful to anyone testing Ajax/JSON heavy applications. Thank you Vadim.
|
|
0
link
|
Vadim @StresStimulus Administrator Posts: 583
9/9/2014
|
This feature was developed in the new beta revision posted today.
|
|
0
link
|