question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Actions can't be performed in iframe on fiddle.net

See original GitHub issue

What is your Test Scenario?

I’m trying to record actions in a result iframe on fiddle.net after click on a Run button https://github.com/DevExpress/testcafe-studio/issues/2052

What is the Current behavior?

Error raises TestCafeDriver doesn't exist in the iframe

What is the Expected behavior?

I expect TestCafeDriver exists in the iframe

Steps to Reproduce:

The easiest way to reproduce is to run a following test:

import { Selector } from 'testcafe';

fixture `f`
    .page `https://jsfiddle.net/`;

test('t', async t => {
    await t
        .debug() //resume after loading is complete
        .click(Selector('#run'))
        .debug() // resume after result iframe has a white background
        .switchToIframe(Selector('[name="result"]'))
        .click(Selector('body')); // error raises 'Content of the iframe in which the test is currently operating did not load.'
});

On the second debug action you can check that TestCafeDriver instance doesn’t exist in iframe image

Your Environment details:

  • testcafe version: 0.23.3

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LavrovArtemcommented, Feb 7, 2019

I’ve investigated this problem and figured out that a processed form action attribute has no iframe flag because there is no iframe with the ‘result’ name during a server processing.

Simplified server for reproducing
require('http')
    .createServer((req, res) => {
        switch (req.url) {
            case '/':
                res.writeHead(200, { 'content-type': 'text/html' });
                res.end(`
                    <form target="result" action="/result"></form>
                    <div id="result"></div>
                    <button id="run">Run</button>
                    <script>
                        document.querySelector('#result').innerHTML = '<iframe name="result"></iframe>';
                        document.querySelector('#run').onclick = function () {
                            document.querySelector('form').submit();
                        };
                    </script>
                `);
                break;
            case '/result?':
                res.writeHead(200, { 'content-type': 'text/html' });
                res.end(`<h1>result iframe</h1>`);
                break;
            default:
                res.end();
        }
    })
    .listen(2222, () => console.log('http://localhost:2222/'));
0reactions
AlexKamaevcommented, Aug 2, 2021

I could not reproduce the issue from the first post, so I closed this issue about ‘fiddle.net’. I created separate issues for other cases discussed in this ticket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Embed script snippet not working as expected · Issue #732
Hi,. we came across this issue where copying the embed <script> string of a fiddle would not work when embedding it to an...
Read more >
Can't write to iframe in FF or IE, only Chrome
When called in order, I imagine it would work properly in CHrome, but not in IE & FF. Judging by the jsfiddle result....
Read more >
Button click on iframe
Create an iframe in verge and set the SRC to the html file you just created. Add your control buttons use the execute...
Read more >
Player API not functional when explicit iframe tag (without ...
I can see that if you trigger player action from JS API player is not triggering PlayerStateChange event. You can't also read correct...
Read more >
Setting up single-player tests before adding spinner
This code here I believe I put together from this post. https://jsfiddle.net/2vs7d95g/ function onPlayerReady(event) { const iframe = player.h; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found