0
votes

I am doing performance testing of Web Services which involves HMAC authentication. Details are:

  1. A java script has been developed which will create a signature, MD5 code and nonce number before a request is sent from the API

  2. This information generated above will be passed on to variables defined in the script which will authenticate before making a request.

  3. Once authentication is successful the request will be sent and valid response will be obtained from DB.

script needs to be put in a beanshell preprocessor of Jmeter: enter image description here

This script will be generating values for the header manager which in turn will do authentication process. enter image description here

The problem is the language in which the script has been written ( JS ) is not compatible with Jmeter i.e jmeter cannot use the script created because it does not understands the language of the script. I came to know that the script has to be modified probably using jquery so that the jmeter beanshell can interpret it and generate values for Date MD-5 Signature

How can I change it to jQuery or is there any possibility to get similar JQuery code, as I do not have much java script coding background.

1

1 Answers

0
votes

Try to use JSR223 Sampler with script language set to javascript (Language: JavaScript).

Reference: https://stackoverflow.com/a/14853893/5159450