Jmeter select dynamic input value

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Jmeter select dynamic input value

zlos7ar
hi I have this input field

<input type="hidden" value="QWKFloLUkM" name="xsrf_tokens[login]"/>

where value is different every time. This is done for security reasons on my login page. The problem is I don't know how to select that value with jmeter.
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter select dynamic input value

zlos7ar
<elementProp elementType="HTTPArgument" name="xsrf_tokens[login]">
<boolProp name="HTTPArgument.always_encode">true</boolProp>
<stringProp name="Argument.value">8sfnaxiuCo</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">xsrf_tokens[login]</stringProp>
</elementProp>

thats my code right now but it does not work because the value is different every time...
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter select dynamic input value

softwaretestingforum
Administrator
but I noticed that you are using name and not values -


<elementProp elementType="HTTPArgument" name="xsrf_tokens[login]">


Did I miss some thing?
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter select dynamic input value

zlos7ar
i have no idea since the code is generated by the badboy

in badboy it is like this :

? lang=en
? xsrf_tokens[login]=8sfnaxiuCo
? login_user=viktor
? login_pw=viktor12345
? submit=Login

and it works in the badboy but when i export it to jmeter it does not work
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter select dynamic input value

softwaretestingforum
Administrator
Can you try to record it using JMeter it self as described here -

http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter select dynamic input value

zlos7ar
how do I run JMeter in windows 7 ? I downloaded it, extracted the files but i dont know how to run it...
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter select dynamic input value

softwaretestingforum
Administrator
You can double click on "jmeter.bat" file in the download location of JMeter. It looks like this for me -

/apache-jmeter-2.6/bin/jmeter.bat

On Unix kind of system you can double click on "jmeter.sh" file
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter select dynamic input value

zlos7ar
Ok thanks but what should i do with the website you give me. I don't want to start the test with a proxy.  I am uploading the .jmx file to a website and there it can be ran from all over the world. I just need some way to check what is the value of the hidden element before i login.
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter select dynamic input value

zlos7ar
problem solved :) jmeter can only use fixed values so i made a simple login hack for the website and i am skipping the login page :)
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter select dynamic input value

softwaretestingforum
Administrator
Glad you solved it.
~ seleniumtests.com