As part of performance testing for the payment endpoints, we are using an iFrame URL to input card details in the browser. In the browser console, we extract a token by running getCardToken(), which is then used in subsequent payment requests.
Is it possible to simulate this process in JMeter? Since getCardToken is executed in the browser console and the card details are encrypted, we’ve tried recording this flow in JMeter but noticed that an encrypted payload is sent when the card details are entered in the browser.
Is there any way to simulate this process in JMeter and retrieve the One-Time Token (OTT)?
As per JMeter project main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it’s possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
So you need to use your browser developer tools to inspect the source code of the page, find this function and re-implement it using JSR223 PreProcessor and Groovy language.