TestCafe hangs on switching to and interacting with iframe contents
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:
Steps to Reproduce:
- Go to my mailchimp.com
- Log in
- Navigate to
/account. - Switch to
#fallbackiframe. - Select
Contact informationfrom the Settings menu options. - Refresh
#fallbackiframe. - Attempt to click anything within the
#fallbackiframe.
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
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.
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?
Hi,
After account verification, I was able to reproduce the issue. We need some time to investigate it. Please stay tuned.
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!
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
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.
I'm experiencing this when trying to switch to an iframe within an iframe.
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.