Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestCafe hangs on click of submit button in an iframe when the click is submitting form and redirecting to a page of a different domain #4232

Closed
lprasanthi opened this issue Sep 3, 2019 · 20 comments · Fixed by #6331
Assignees
Labels
AREA: client FREQUENCY: level 2 Support Center An issue created/received from the Support Center ticket. SYSTEM: driver TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@lprasanthi
Copy link

lprasanthi commented Sep 3, 2019

What is your Test Scenario?

We are testing a page that loads a form in an iframe from source (www.domain1.comapny.com/load).
User completes the form and submit's it to www.domain1.company.com/submit which then redirects to www.domain2.company.com/anotherform(within the same iframe).

Test hangs after submit. It submits and redirects to the new page(i can see in the UI) but is stuck there(window never closes and next steps are not executed).

What is the Current behavior?

What is the Expected behavior?

What is your web application and your TestCafe test code?

Web application is in ruby on rails framework.

Your website URL (or attach your complete example):

Unfortunately I can't share the code but I'm happy to share snippets and video if that helps.
Wanted to understand if this is a limitation with testcafe framework as it's redirecting to a cross domain.

 
Your complete configuration file (if any):

Your complete test report:

Screenshots:

Steps to Reproduce:

  1. Go to my website ...
  2. Execute this command...
  3. See the error...

Your Environment details:

  • testcafe version: 1.3.0-alpha.1
  • node.js version: 12.9.0
  • command-line arguments: "testcafe chrome -e test.js"
  • browser name and version: Chrome Version 74.0.3729.131
  • platform and version: Mac OS Mojave Version 10.14.5
  • other:
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 3, 2019
@alexey-lin alexey-lin self-assigned this Sep 4, 2019
@alexey-lin
Copy link
Contributor

Hi @lprasanthi,

We would love to assist you and diagnose this issue. However, we need to reproduce this issue on our side in order to understand its cause. Without a simple sample project, we are unable to provide any solutions.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Sep 4, 2019
@alexey-lin alexey-lin added the STATE: Need clarification An issue lacks information for further research. label Sep 4, 2019
@alexey-lin alexey-lin removed their assignment Sep 4, 2019
@lprasanthi
Copy link
Author

Hi @alexey-lin I'm happy to help. I'll try to create a sample app and share it with you.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 4, 2019
@alexey-lin alexey-lin removed the STATE: Need response An issue that requires a response or attention from the team. label Sep 4, 2019
@lprasanthi
Copy link
Author

@alexey-lin https://github.com/lprasanthi/TestCafe-ForgotPwd is the code for the test and README has instructions.

@no-response no-response bot removed the STATE: Need clarification An issue lacks information for further research. label Sep 10, 2019
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 10, 2019
@AlexKamaev AlexKamaev self-assigned this Sep 11, 2019
@AlexKamaev
Copy link
Contributor

@lprasanthi
Thank you for cooperation.
I was able to reproduce the issue.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Sep 11, 2019
@AlexKamaev AlexKamaev added TYPE: bug The described behavior is considered as wrong (bug). FREQUENCY: level 2 labels Sep 11, 2019
@AlexKamaev AlexKamaev removed their assignment Sep 11, 2019
@AlexKamaev AlexKamaev added this to the Planned milestone Sep 11, 2019
@lprasanthi
Copy link
Author

Hello, Is there an update on this one ?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Oct 8, 2019
@Dmitry-Ostashev Dmitry-Ostashev self-assigned this Oct 8, 2019
@Dmitry-Ostashev
Copy link
Contributor

We cannot provide any estimates as to when it will be fixed. Stay tuned in this thread to be notified of our progress.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Oct 8, 2019
@Dmitry-Ostashev Dmitry-Ostashev removed their assignment Oct 8, 2019
@sjt003
Copy link

sjt003 commented Apr 16, 2020

bump

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Apr 16, 2020
@alexey-lin
Copy link
Contributor

@sjt003, thank you for your feedback. Please note that you can just react with +1 to the original post. It will help us keep the discussion clean and clear.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Apr 17, 2020
@AndreyBelym AndreyBelym added the Support Center An issue created/received from the Support Center ticket. label May 27, 2020
@Srutherford2407
Copy link

Any update on this or possible work around?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Dec 9, 2020
@Ogurecher
Copy link
Contributor

@Srutherford2407, We don't have any updates on this issue. In the meantime, you can use the workaround from this thread.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Dec 10, 2020
@tomchan-bot
Copy link

Hi is there any update on this? Many thanks.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Mar 3, 2021
@wentwrong
Copy link
Contributor

@tomchan-bot
There are no updates on this from our side. But as @Ogurecher mentioned above, there is a workaround one can do: switch to the iframe and click the submit button via ClientFunction instead of using the t.click action.

test('Switch and submit', async t => {
    await t.switchToIframe('iframe');
    await ClientFunction(() => document.querySelector('input').click());
});

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Mar 3, 2021
@barking-timber
Copy link

barking-timber commented Mar 9, 2021

Hey, two things from me on this problem. We recently stumbled upon this and the issue makes most of our tests redundant :/

  1. The issue itself - does it happen to you only on Macs? Our dev machines are Macs, and at first, we noticed tests hanging on them. But also, just now, we've found the other test hanging in the pipeline (which is running on Docker image node:15.5.0-alpine) while the same test pass on Mac. So frustrating :/
  2. BTW we tried the trick with the ClientFunction above. It turned out that it didn't click the button at all.

Hope this will add some insight 🤞

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Mar 9, 2021
@Dmitry-Ostashev
Copy link
Contributor

@biniosuaf

Thank you for the information. We'll take it into account.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Mar 11, 2021
@wentwrong wentwrong self-assigned this Jun 10, 2021
@stella-jivkova
Copy link

Hello,
I can see that a fix has been merged regarding this issue, but I'm still reproducing it with 1.18.5 version of TestCafe.
Can you please confirm if this is supposed to be fixed in the mentioned version?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Apr 15, 2022
@felis2803
Copy link
Contributor

@stella-jivkova This issue should not be reproducible. So, I assume that the problem you encountered is different. Could you share a small example so that we can investigate this on our side?

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Apr 18, 2022
@stella-jivkova
Copy link

stella-jivkova commented Apr 18, 2022

@felis2803 the case is as follows:
Our application is calling for 3DS verification of a credit card payment. The 3DS simulator loads on a new page and part of its contents (including the <form> to be submitted, a dropdown for choosing the response to be simulated and the submit button (of type <input>)) are inside of an iframe.
Clicking the submit button is supposed to trigger addition of the slected response to the form data and then post the form data to a different domain.
However, clicking the submit button triggers nothing and the execution is stuck at the 3DS simulator page.

Upon some investigation with our FE Dev we were able to detect that the submit form has an event listeren, which scope is being changed by TestCafe. I'm attaching a comparison of how things differ between the automated executin via TestCafe and a manual scenario.

Screenshot 2022-04-15 at 14 58 33

Please, let me know if additional information is needed.

EDIT: After trying to work around the issue, there's some important info to add - the <input> elements that fill the form data are not children of the form, but are separate elements also located inside the iframe. It looks like for some reason TestCafe is blocking the form's access to those elements.
Screenshot 2022-04-18 at 16 02 21

The workaround we've just found is to use ClientFunction() in order to recreate those elements as children of the form element and then use form.submit() directly, instead of triggering the submit with the Submit button.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Apr 18, 2022
@felis2803
Copy link
Contributor

@stella-jivkova This is indeed a different bug that has similar symptoms. Please open a new issue. Also, please attach a link to a repository that reproduces this bug so that we can run it and investigate.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Apr 19, 2022
@chaithanyvv
Copy link

Hi,
Our application involves 3DS validation page where we were using Testcafe 3.3.0 . We are unable to load 3DS page using Testcafe as the hammerhead proxy is blocking the components from loading. The same scenario works with Selenium and we do not face any issues in it. Can you fix this 3DS page load issue in Testcafe ?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Oct 18, 2023
@Aleksey28
Copy link
Collaborator

Hi @chaithanyvv,

This issue is resolved. Please create a separate issue with a simple sample. Also, please follow this instruction about creating simple examples.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AREA: client FREQUENCY: level 2 Support Center An issue created/received from the Support Center ticket. SYSTEM: driver TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

Successfully merging a pull request may close this issue.