DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.82k stars 670 forks source link

The switchToIframe method does not wait for iframe load and raises an error #2387

Closed MarinaRukavitsyna closed 6 years ago

MarinaRukavitsyna commented 6 years ago

Are you requesting a feature or reporting a bug?

A bug

What is the current behavior?

The switchToIframe method does not wait for iframe load and raises an error

What is the expected behavior?

The switchToIframe method should wait for iframe load.

Provide the test code and the tested page URL (if applicable)

await t
        .setPageLoadTimeout(47000)
        .navigateTo(`page`);

await t
        .switchToIframe(iframe)   
        .click(button);

Specify your

konstantinmaximov commented 6 years ago

http://ccnet.devexpress.devx/ccnet/server/farm/project/AspTestCafe.VisualTests.Bootstrap.Demos.CardView.v18.1/build/log20180515010054.xml/ViewBuildReport.aspx

http://ccnet.devexpress.devx/ccnet/server/farm/project/AspTestCafe.VisualTests.Bootstrap.Demos.GridView.v18.1/build/log20180515010208.xml/ViewBuildReport.aspx

I was not able to reproduce this behavior locally, but on the Farm the same test fails every time. Increasing the SwitchToIframe command timeout to 25000 has no effect. Changing WAIT_FOR_PARENT_DRIVER_RESPONSE_TIMEOUT to 15000 does not help either. The latest 0.20.0-alpha.4 version does not solve this problem.

MariaRyadchikova commented 6 years ago

Hey guys, I know it has already been included into the sprint, but is there any time frames when you plan to resolve the issue? This one is blocking me pretty badly. Thanks!

AndreyBelym commented 6 years ago

@MariaRyadchikova, I think I'll fix it next week, and publish an alpha build with the fix.

MariaRyadchikova commented 6 years ago

Hey guys, it's been more than a month since the issue was reported, and the sprint is about to end. Any more accurate forecasts? The issue blocks from working with any frames.

miherlosev commented 6 years ago

I cann't reproduce the problem with the latest commit (https://github.com/DevExpress/testcafe/commit/a9a1c1e5841d5923b0970df168fc0ce35618c223).

import { Selector } from 'testcafe';

fixture `test`
    .page('http://builder03/Demos-18.2/Bootstrap/CardView/Adaptivity.aspx');

test('test', async t => {
    const demoIframe = Selector('.demo-frame');
    const body       = Selector('body').exists;

    await t
        .switchToIframe(demoIframe)
        .expect(body).ok();

    await t.switchToMainWindow();
});
lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.