How to handle payment gateway when using iframe to send data

Hi Team,

How can we achieve a payment gateway when the parameters passing is in an encrypted format. At present in the commerce cloud, we are using an iframe for sending data.

For other scenarios I have used ajax calls to send data successfully but coming to the payment gateway, is there any alternative solution like clicking the button as in the demo application.

Sumanth P

Welcome to load testers hell. You can only try to get the parameters somehow assembled in case they are already in the page. Typically JS does barely work nowadays with non-real-browsers due to the advanced JS-versions in comparison to HTMLUnit. Yes, you can switch on JS before the page load and see what happens and if this will be handled ok.

Most of the time, we see if we can get the Java version of the external payment gateway to handle the encryption or whatever they might do.

What payment are you fighting with right now?

Adyen and paypal for now .

Yes, these both took quite some time to implement and break often when they roll new code or other updates.

We cannot share this code, because this is project work and not freely available.

Thanks for the reply @rschwietzke ,

Can you please give more details on your statement below “Yes, you can switch on JS before the page load and see what happens and if this will be handled ok.”

Do you mean we need to enable JavaScript and click on the button after the page loads to see if it works ?

Sumanth P

Hi @rschwietzke , I am also facing a similar issue. Can we get around this limitation by creating a load test script using pure WebDriver tests with the test class inheriting com.xceptance.xlt.api.tests.AbstractWebDriverTestCase ?

as mentioned in Can I reuse Selenium scripts in XLT for load testing?

You could and there is also a test suite for that approach, but you can only run that for the entire user, there is not way to have later use a real browser and earlier a fake browser.

That must be paid by hardware. A real browser eats 2-4 cores and up to 1 GB of memory. The amount of traffic you can run is way lower than when running straight request simulation either by HttpClient or HtmlUnit.

The WebDriver part also uses a different API hence just changing the parent class does not work.

Before you load that page, you have to enable JS:


For instance in the prevalidate part of an action. If you are not longer need the JS engine running, disable it again. It eats a lot of memory and performance.

But this does not guarantee that this work, due to the difference of the JS supported by HtmlUnit and what browser speak and use. Also many libs are user specific browser features and not all of these features are implemented in HtmlUnit.

That makes sense. Thanks for your help @rschwietzke ! Appreciate you for taking the time to look in to the issues ! :bowing_man: