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.

redirect after iFrame dosen't happening

See original GitHub issue

Are you requesting a feature or reporting a bug?

Maybe it is a bug, I’m not sure, I just want to try testcafe…

What is the current behavior?

I want to build a login script, after login via iFrame the redirect dosen’t happening and I will get a 404 page, this is my test script: import { Selector } from ‘testcafe’; import {ClientFunction} from ‘testcafe’

fixture Getting Started// declare the fixture .page https://www.aboutyou.de/; // specify the start page

//then create a test and place your code there test(‘Login test with new User’, async t => { const getLocation = ClientFunction(() => window.location.href);

	// NOTE: the ClientFunction will be executed in TOP window's context
	console.log(await getLocation());
await t
    .click('button.login_8b49da')
    .switchToIframe('.iframe_1k7bcr7')
    .typeText('body > main > div > div.login-section.fade-in-out-transition > form > div:nth-child(1) > div > input', 'test@test.de3')
    .typeText('body > main > div > div.login-section.fade-in-out-transition > form > div.form-wrapper > div > div > div:nth-child(2) > input', '12345')
    .click('body > main > div > div.login-section.fade-in-out-transition > form > button')
    .switchToMainWindow()
    .expect(Selector('#app > section > div.navigation_1ie55wv > div.topWrapper_17208h5 > div > div.logoContainer_9563j8 > a > div > div.youWrapper_pzivoe > div.text_1apmb75-o_O-nick_ay4wjb').innerText)
        .eql('vorname');

});

What is the expected behavior?

I should be redirected to the main page. If I’m doing a manually log in after the iFrame I will go trough this redirects:

Status Code URL IP Page Type Redirect Type Redirect URL 302 https://checkout.aboutyou.de/oauth/success ...* server_redirect temporary https://www.aboutyou.de/oauth?state=* 200 https://www.aboutyou.de/oauth?state=* ...* client_redirect javascript https://www.aboutyou.de/ 200 https://www.aboutyou.de/ ...* normal none none

How would you reproduce the current behavior (if this is a bug)?

please try my provided script

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

it is in the “What is the current behavior?” section Tested page URL: https://www.aboutyou.de/ Test code

import { Selector } from 'testcafe';
import {ClientFunction} from 'testcafe'

fixture `Getting Started`// declare the fixture
    .page `https://www.aboutyou.de/`;  // specify the start page


//then create a test and place your code there
test('Login test with new User', async t => {
	const getLocation = ClientFunction(() => window.location.href);

    	// NOTE: the ClientFunction will be executed in TOP window's context
    	console.log(await getLocation());
    await t
        .click('button.login_8b49da')
        .switchToIframe('.iframe_1k7bcr7')
        .typeText('body > main > div > div.login-section.fade-in-out-transition > form > div:nth-child(1) > div > input', 'test@test.de3')
        .typeText('body > main > div > div.login-section.fade-in-out-transition > form > div.form-wrapper > div > div > div:nth-child(2) > input', '12345')
        .click('body > main > div > div.login-section.fade-in-out-transition > form > button')
        .switchToMainWindow()
        .expect(Selector('#app > section > div.navigation_1ie55wv > div.topWrapper_17208h5 > div > div.logoContainer_9563j8 > a > div > div.youWrapper_pzivoe > div.text_1apmb75-o_O-nick_ay4wjb').innerText)
            .eql('vorname');
});

Specify your

  • operating system: mac 10.13.4 (17E199)
  • testcafe version: 0.19.2
  • node.js version: v9.10.1

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
miherlosevcommented, Sep 28, 2018

I’m working on this

1reaction
macdonaldr93commented, Jul 3, 2018

Hey @AndreyBelym, I’m having the same issue where the state param is being dropped in the roundtrip for oauth. We’re in the same boat as @sebokgabor84 where we’re inside an iFrame. I’m wondering if there is any progress on debugging/solution for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redirect Url Is Not Working with Iframe - Stack Overflow
when user click on video url it must redirected to you video. we are using html5lightbox plugin . problem im facing: redirection is...
Read more >
Help! Redirect upon completion not working in iframe
Upon form submission, the Typeform inside the iframe redirects to the results page, and the parent page containing the iframe is unaffected.
Read more >
URL Redirect: Breaking Out of an iFrame - Alchemer Help
The first option is to open the new website in a new window, which would accomplish the goal of "breaking out" of the...
Read more >
Redirect Blocked iFrame not working - Jotform
Hi, I am trying to make a form with a redirect on submission. I noticed the redirect was being blocked by Chrome so...
Read more >
URL Redirection not happening Automatically when called ...
URL Redirection not happening Automatically when called from inside iFrame · Make sure the path which you have specified in "src=" is valid...
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