Running JS in loadrunner

Hello Everyone,

I have a scenario where during recording there is an encrypted value being sent in the call . Upon analysing , the value is generated using an encryption mechanism and the function takes all the form values from the page which is then encrypted . For ex., if there is single form in the page , all the input elements from that form is passed as a parameter in an array format within the function using document.forms[i].Element . 
Since it is dynamic , is there a way to make the js function read the HTML page as document .

 Could someone help

  • 0  

    ,

    Looks like something as OAuth or a JSON Web Tokens. Likely this involved a bit more than only the from-values. But when you can use the JS function to generate the special value, that leaves you only with finding the proper from field values.

    Working with JS scripting, does not involve access to the DOM of the page, so you have to grep those values yourself via correlation like technics. I guess when you setup something that looks voor all the from fields and corresponding values (use reg.exp. and Ordinal=ALL, it might be not that complicated.

    Success, Erik

    How to ask questions

    Reward contributions via likes or 'verified answers'

  • 0 in reply to   

    Hello Erik, 

    thank you for your response . The js code is trying to submit forms by taking the input elements . 
    Though I can pass all the needed parameters using correlation to the js file,  how can load runner submit the form that that is called in js . This is something I’m unable to figure out . Any insights would be of great help to me. Thanks in advance.

  • Suggested Answer

    0   in reply to 

    , normally you make a recording of your business flow in e.g. 'Web HTML/HTTP' protocol. That flow will then also contain the submission of the form to the backend. This submission needs to be changed (add parameters, perform your JWT (?) calculation).

    You can also craft calls by hand, but that might be cumbersome. Consult the documentation and use e.g. a Network trace of your browser to see the content of that call.

    How to ask questions

    Reward contributions via likes or 'verified answers'