Hello,
I want to create a unique ID using a BSF PreProcessor script and use that for the http requests to be able to map every request on the backend. My script works fine but the sampler variable contains the output from the previous sampler request!

My testplan
   tread group 1
       BSF PreProcessor
           id=...
           vars.put('GUID', id)
       HTTP Header Manager
           X-GUID = ${GUID}
       loop controler
           HTTP Request 1
           HTTP Request 2
       Simple Data Writer csv
           test.csv
       Simple Data Writer xml
           test.xml

jmeter.properties sample_variables=GUID When executing the script, the HTTP request header variable ${GUID} contains the variable from the previous request but the output of sample_variables=GUID in the logfile lists the actual value. The very first request has an empty value. Is there something I have to take into account when setting variables in a BSF ProProcessor script? It looks like that the variable in the HTTP Header Manager is populated _before executing the BSF Preprocessor...

Does anybody have an idea how to get the correct values in the request?

The simplyfied XML output from the Simple Data Writer looks like
<httpSample GUID="2c3b75c3-d057-47fd-af42-109408513d5c">
   <requestHeader class="java.lang.String">X-GUID: ${GUID}</requestHeader>
</httpSample>
<httpSample GUID="edb03730-e890-4185-8cbb-622abfb42ff9">
<requestHeader class="java.lang.String">X-GUID: 2c3b75c3-d057-47fd-af42-109408513d5c</requestHeader>
</httpSample>

Maybe this is related to this bug?
http://www.mailinglistarchive.com/[email protected]/msg12579.html

Thanks
Heiko

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to