testcafe icon indicating copy to clipboard operation
testcafe copied to clipboard

TestCafe hangs on switching to and interacting with iframe contents

Open kacy-weakley opened this issue 5 years ago • 8 comments

What is your Test Scenario?

Update Mailchimp contact information on the Account's page.

What is the Current behavior?

The test hangs after navigating to the Account's Contact Information page.

The test passes when using the Testcafe release tar file provided to my team months back (testcafe-1.8.9-202007110043.tar.gz). That custom 1.8.9 Testcafe release does not work for all of our iframe issues, though, so the latest release is necessary for other tests to work as expected.

If we navigate directly to /account/contact, we are able to switch to iframe and interact with its contents as expected. We would prefer not to go this route, though.

What is the Expected behavior?

The test shouldn't hang when switching to an iframe and attempting to interact with its elements.

What is your web application and your TestCafe test code?

Your website URL (or attach your complete example):

https://us20.admin.mailchimp.com/account

Your complete test code (or attach your test files):
 import { Selector } from 'testcafe';

const fallbackIframe = Selector("#fallback").with({ timeout: 20000 });
const settingsLink = Selector("span").withText("Settings ");
const contactInformationLink = Selector("a").withAttribute("href", "/account/contact");
const contactIframe = Selector("#fallback[src *= '/account/contact']").with({ timeout: 20000 });
const editContactInformationButton = Selector("a").withText("Edit Contact Information");

fixture `Account`
    .beforeEach(async t => {
       // log in to Mailchimp
    });

test('Edit Contact Information', async t => {
      await t
      .navigateTo(`../account`)
      .switchToIframe(fallbackIframe)
      .click(settingsLink)
      .click(contactInformationLink)
      .switchToMainWindow()
      .switchToIframe(contactIframe) // Browser hangs indefinitely
      .click(editContactInformationButton);
});
Your complete configuration file (if any):

Your complete test report: ``` There is no test report, because the test never finishes. ```
Screenshots: Screen Shot 2021-06-09 at 12 05 09 PM

Steps to Reproduce:

  1. Go to my mailchimp.com
  2. Log in
  3. Navigate to /account.
  4. Switch to #fallback iframe.
  5. Select Contact information from the Settings menu options.
  6. Refresh #fallback iframe.
  7. Attempt to click anything within the #fallback iframe.

Your Environment details:

  • testcafe version: 1.14.2
  • node.js version: 10.16.3
  • command-line arguments: testcafe chrome ./test.js
  • browser name and version: Chrome 91.0.4472.77
  • platform and version: macOS 10.15.7

kacy-weakley avatar Jun 09 '21 19:06 kacy-weakley

Hello,

We would love to assist you and diagnose this issue. It seems like an account should be verified to reproduce the problem. Since the website requires authentication, I will not be able to access it and reproduce the issue unless you provide your credentials. Also, our policy prevents us from accessing a customer's internal resources without prior written approval from the entity that owns the server/web resource.

If you want us to research the problem further, we'll need access to the server/web resource. Please ask the website owner to send us ([email protected]) written confirmation. It must permit DevExpress personnel to remotely access the website and its internal resources for research/testing and debugging purposes.

AlexanderMoiseev avatar Jun 10 '21 11:06 AlexanderMoiseev

This isn't testing an internal service. This test is against the production instance of Mailchimp. I can't share my login credentials with you, but anyone can create a free account. Are you not able to do that?

kacy-weakley avatar Jun 10 '21 13:06 kacy-weakley

Hi,

After account verification, I was able to reproduce the issue. We need some time to investigate it. Please stay tuned.

AlexanderMoiseev avatar Jun 11 '21 07:06 AlexanderMoiseev

Hello, We have experienced the same issue. It happens for us on Ecommerce platform during the checkout with the payment provider iframe. TestCafe switches to iFrame, but refuses to switch back to main frame and hangs indefinitely, until we eventually forcefully shut it down. I can't share an example due to company policy. Hope this helps. Thanks!

AlexGrisin avatar Jul 16 '21 08:07 AlexGrisin

A similar thing is happening for us, on remote browsers (BrowserStack iPhone 8 -> 12 Pro Max). Happy to provide more info, unless you have everything else you need to investigate

rob4629 avatar Aug 20 '21 00:08 rob4629

Hi,

Thank you for bringing this to our attention. We didn't manage to address this issue yet. Once we have any news, we will post them here.

AlexanderMoiseev avatar Aug 23 '21 06:08 AlexanderMoiseev

I'm experiencing this when trying to switch to an iframe within an iframe.

boy51 avatar Oct 02 '21 16:10 boy51

Hi @kacy-weakley,

The issue doesn't occur in the latest TestCafe version (2.6.0). If it does on your side, please let us know.

Aleksey28 avatar May 25 '23 14:05 Aleksey28