3
votes

In my project there is a scenario that

user will log in -> browse some pages -> then he will click on the logout link .

to test this scenario in JMeter, I used CSV config so that I can test this scenario for 50 users. during logout, each user unique userid is sent as request in the MD5 format.

How can I sent the userid in MD5 format in JMeter?

3
wait wait, you want to "mock" the service response? I'm confused can you re-phrase? or am I getting it right?ant
what i want to mean is , under thread group i add a common csv config element ,that csv contains the user details .Neil
aha good. and what do you want to do with those details?ant
what i want to mean is , under thread group i add a common csv config element ,that csv contains the user details . now i add a simple controller under thread group , i gave the controller name " login" . now under the controller login there is the http request for login.in that http request parameter i sent the username and passoword dynamically using variable[ ${username} ,&{password}. now in the logout section http request , userid of each user is sent in the md5 format. so what i want to know that how can i sent the userid in md5 format during logout. hNeil
here i want to mention one point that in the user csv there was also a column userid , so can i use that field here.Neil

3 Answers

2
votes

You can easily use custom MD5 function from JMeter Plugins set.
This will look like ${__MD5(${username})}.

Here is also demo-script from plugin's author available, attached to conversation.

0
votes

You can grab the dynamic user/session ID using a regex, then calculate the MD5 using BeanShell preprocessor. Some sample code is available here and there.

0
votes

Actually MD5 function was removed, use __digest with MD5 as first parameter instead:

${__digest(MD5,Errare humanum est,,,)}

returns c49f00b92667a35c63708933384dad52