testcafe: Content of the iframe did not load

I see that there are some bug reports, that describe similar (or the same) issue, e.g. # 2406, however they have been closed for inactivity or other reasons, and I still don’t see a solution. Hopefully, my feedback could help identify the issue.

What is your Test Scenario?

I am trying a very simple test - verifying that some text, for example “Host Status”, exists on a page.

What is the Current behavior?

I see the following error:

1) Content of the iframe in which the test is currently operating did not load.

when using testcafe ver. 1.2.1. In addition to this, I see:

(node:1842) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.

None of these errors were present in testcafe ver. 0.20.0.

Here’s the entire output:

 Running tests in:
 - Firefox 67.0.0 / Ubuntu 0.0.0

 Nagios XI Tests
(node:1842) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
 ✖ Host Status

   1) Content of the iframe in which the test is currently operating did not load.

      Browser: Firefox 67.0.0 / Ubuntu 0.0.0

         30 |  await t
         31 |    .useRole(admin)
         32 |    .click( Selector('a').withText('Home') )
         33 |    .click( Selector('a').withText('Host Status') )
         34 |    .switchToIframe( '#maincontentframe' )
       > 35 |    .expect( Selector('h1').withText('Host Status').exists ).ok()
         36 |    .expect( Selector('.hoststatustar_').withText('All hosts').exists ).ok()
         37 |    .expect( Selector('.xi-table-recordcount').withText('Showing').exists ).ok()
         38 |});
         39 |

         at ok (/home/ludmil/testcafe/XI/Home/Left Menu/Details/host_status.js:35:62)
         at <anonymous> (/home/ludmil/testcafe/XI/Home/Left Menu/Details/host_status.js:29:1)
         at <anonymous> (/usr/lib/node_modules/testcafe/src/api/wrap-test-function.js:17:28)
         at TestRun._executeTestFn (/usr/lib/node_modules/testcafe/src/test-run/index.js:243:19)
         at TestRun.start (/usr/lib/node_modules/testcafe/src/test-run/index.js:292:24)



 1/1 failed (38s)

What is the Expected behavior?

I expect my test to succeed as it used to in testcafe ver. 0.20.0.

Example:

 Running tests in:
 - Firefox 61.0.0 / Ubuntu 0.0.0

 Nagios XI Tests
 ✓ Host Status


 1 passed (29s)

What is your web application and your TestCafe test code?

Public link: http://nagiosxi.demos.nagios.com/nagiosxi

host_status.js

import { Role } from 'testcafe';
import minimist from 'minimist';

const args = minimist(process.argv.slice(2));
const baseurl = args.baseurl;

fixture ('Nagios XI Tests')
  .page( baseurl )

// Roles

const admin = Role(baseurl, async t => {
  await t
    .typeText('#usernameBox', 'nagiosadmin')
    .typeText('#passwordBox', 'nagiosadmin')
    .click('#loginButton')
});

// Tests

/* Template
test('Test Name', async t => {
  await t
    .useRole(admin)
});
*/

test('Host Status', async t => {
  await t
    .useRole(admin)
    .click( Selector('a').withText('Home') )
    .click( Selector('a').withText('Host Status') )
    .switchToIframe( '#maincontentframe' )
    .expect( Selector('h1').withText('Host Status').exists ).ok()
    .expect( Selector('.hoststatustar_').withText('All hosts').exists ).ok()
    .expect( Selector('.xi-table-recordcount').withText('Showing').exists ).ok()
});

Your Environment details:

testcafe version: 1.2.1

node.js version: v12.4.0

command-line arguments: testcafe -c 1 firefox:headless host_status.js --baseurl=‘http://nagiosxi.demos.nagios.com/nagiosxi’ -e

browser name and version: Firefox Quantum 67.0.2 (64-bit)

platform and version: Ubuntu 18.04.2 LTS

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 54 (14 by maintainers)

Commits related to this issue

Most upvoted comments

This is still happening for us as of version 1.5.0. The iframe issue is a roadblock for our site’s implementation. Would love to see this get fixed.

I’m having a similar issue with TestCafe 1.5, ‘Content of the iframe in which the test is currently operating did not load.’ Thought we don’t have any issue with Node TLS, so this may not be the same issue.

This is blocking a number of our teams from moving to TestCafe. Code to repro:

fixture`Iframe issue`
  .page`https://mswailes.instructure.com/courses/540592/external_tools/10621`;

test('iframe test', async (t) => {
  const teacherLogin = 'tcbugs@tcbugs.edu';
  const teacherPassword = 'password';

  await t.typeText('#pseudonym_session_unique_id', teacherLogin);
  await t.typeText('#pseudonym_session_password', teacherPassword);
  await t.click('.Button--login');

  await t.switchToIframe('#tool_content');
  await t.expect(Selector('main').visible).ok();
});

Hi guys. My tests also affected by this issue, but I wanted to provide example of working test with an iframe:

import { Selector } from 'testcafe';

fixture`Iframe issue`
  .page`https://the-internet.herokuapp.com/iframe`;

test('iframe test', async (t) => {
  await t.switchToIframe('#mce_0_ifr');
  await t.expect(Selector('body').visible).ok();
});

will that help @Farfurix @LavrovArtem @miherlosev ?

@AndreyBelym Good to see it’s solved. When can we expect it to be released? As @dariadomagala said, this bug is blocking us pretty hard 😃 1.8.5-alpha.2 doesn’t fix the problem in case it should.

Is there a plan to fix it anytime soon? It’s blocking us. In our case, all test work properly locally, this error occurs only when we run tests on a cluster with a docker image.