2

Out site is using lots of angular Js. now when I record script for login it has some 5-6 requests recorded. out of those 3 requests are having endcoded key in body data as below.

{"Info":"V8P+Pq/Mq9zNIe0auzRwDvTs+m3tv2gcCGUiU/hI2elP45n2ySmevibc5XFoyhrO"}

I have checked this key is not coming from server and it seems to be generated by client side. this key is different for each user.

however for 1 user key remains same everytime i login. currently I am using approach where I store this keys for all 50 user in CSV file and parameterizing it as below;

{"Info":"${LastLoginKey}"}

is this correct approach? or shall I do something smart ? because this required me to record key for each user manually and then putting in CSV.

2

If the key comes from the client - you need to inspect the source code of the response (especially JavaScript) and identify what parameters and how exactly are encoded. If you will be lucky enough you will be even able to re-use the same code in JSR223 PreProcessor which can execute JavaScript code and set JMeter Variables.

Also starting from JMeter version 4.0 there is __digest() function which can generate MD2, MD5, SHA-1, etc. hashes.

  • Exactly. I could spot the Javascript functions at client side and then I implemented JSR223 PreProcessor in my scripts. and it worked nicely for any number of users I wanted !! – maitray bhatt Mar 14 '18 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.