Forum Discussion

wsgarcia's avatar
wsgarcia
New Contributor
29 days ago

Disabling security for iFrame is restricting a card payment processor

I am testing a payment process that goes thru One Inc, a third party payment processor. We don't test the processor, we just use to get thru the process. This uses an iFrame in a modal. 

Until recently this was working. I'm still researching what changed, but I want to see if anyone else has a solution to this. 

With TestComplete you have to open the browser with the following flags in order to access the iFrame objects

--disable-site-isolation-trials

--disable-web-security

--user-data-dir=<profile dir>

The problem I'm having now, is the card validation is not passing and it won't process the card. What I'm getting a Cloudflare Turnstile error that doesn't seem to like the security settings. 

The solutions I've found have basically said I need to enable the security, but obviously that's not an option. Or is it? That's the question I have. Is there anyway for me to access the iFrame without disabling the security? 

Any suggestions would be greatly appreciated. 

4 Replies

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Icon for Champion Level 2 rankChampion Level 2

    If security restrictions are blocking automation, the best course of action is to explore alternative solutions rather than trying to bypass security measures.

    1. TestComplete can access iFrames, but only if the browser security settings allow it. By default, browsers enforce same-origin policy, which prevents cross-origin iFrame interaction. To bypass this, users often disable security settings like --disable-web-security and --disable-site-isolation-trials. If the payment processor has updated its security measures, it may now detect these settings and block interactions.
    2. TestComplete itself cannot override browser security policies. The best approach is to check if One Inc provides an alternative way to interact with the payment processor, such as an API or a different integration method.
    3. Using keyboard interactions (Keys Method) is a possible workaround, but it may not be reliable for complex interactions within an iFrame. If the iFrame content responds to key presses, you might be able to send keyboard inputs directly to it.

    https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-sys-desktop-pda/keys-method-sys-desktop-object.html 

    P.S. if you like a post give credit and click like, and if it addresses your issue help the community and mark it as a solution.

  • wsgarcia's avatar
    wsgarcia
    New Contributor

    That's the solution I have currently implemented and it's been working great up to now. I was hoping to find another way to access the iFrames. 

    I'll have to look for another solution. Thank you for the response. 

  • wsgarcia's avatar
    wsgarcia
    New Contributor

    Thank Hassan. I'll take your suggestions under advisement. I am reaching out to our dev team to find a solution from One Inc. Crossing my fingers they have something.