playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] "TypeError: Cannot read properties of undefined (reading 'childFrames')" when running tests in Firefox

Open eatonjl opened this issue 3 years ago • 7 comments

Context:

  • Playwright Version: 1.28.0-alpha-oct-28-2022
  • Operating System: Mac (M1 Pro)
  • Node.js version: v16.16.0
  • Browser: Firefox
  • Extra:

Code Snippet

import { test } from '@playwright/test';

test('test', async ({ page }) => {
  await page.goto(
    'https://id2.navexglobal.com/SecureTokenServer/Auth/SamlLogin?SAMLRequest=jZJfa9swFMW%2FitF7LFsLaSbiQNpQFsg2t3b7sJciy9eJmCy5ulL%2FfPvKzko7xkpBD%2BLq8Lv3nKsVil4PfBP80VzDfQD0yVOvDfLpoSDBGW4FKuRG9IDcS15tvu85SzM%2BOOuttJokG0RwXllzYQ2GHlwF7kFJuLneF%2BTo%2FYCc0tZa1wuTGvEATwdtG6FTaXtaHVXTWA3%2BmCJaOuIZLX9WNUm2cR5lxEh%2B46iW%2FcsAGRzU9jeYsTU4OlqiVTSxtwdlSLLbFuSuW3YLaDNYZPOzufwSTytFEy9z1nXZYhlliAF2Br0wviAsY2yWZzO2rFnG48m%2F%2FiJJ%2Bcf3uTKtMoePQ2pOIuTf6rqcnWzdgsPJUhSQ9WqMmk%2BN3bvwP8aK18TJ%2BvP5rui7Vqe%2BA%2F8R2bttabWSz8lGa%2Ft44UB4KEhOkssR6f8%2FSp7mU0W1s26S8mBwAKk6BS1JqnKkXwWhx4IriAje9tM%2BfVwtKg%2BErk9j%2Ff0L1y8%3D&RelayState=cookie%3A1666988419_8131'
  );
  await page.getByPlaceholder('User name').fill('Martin1');
  await page.getByPlaceholder('Password').fill([PASSWORD]);
  await page.getByRole('button', { name: 'Sign In' }).click();
  await page
    .getByRole('link', { name: 'Policy & Procedure Management' })
    .click();
  await page.locator('id=SideBar_NewDocuments').click();
  const [page1] = await Promise.all([
    page.waitForEvent('popup'),
    page.getByRole('link', { name: 'HTML Document HTML Document' }).click(),
  ]);
  await page1
    .frameLocator('iframe[name="WizardPanelPropertiesEdit_Iframe"]')
    .locator('input[name="ctl00\\$ContentPlaceHolder1\\$TitleField"]')
    .fill('Test');
  await page1
    .frameLocator('iframe[name="WizardPanelPropertiesEdit_Iframe"]')
    .getByRole('button', { name: 'Save' })
    .click();
  await page1.getByRole('cell', { name: 'Reviewers' }).click();
  await page1
    .frameLocator('iframe[name="WizardPanelPropertiesEdit_Iframe"]')
    .frameLocator('#UserFinderFrame')
    .locator('input[type="checkbox"]')
    .check();
  await page1
    .frameLocator('iframe[name="WizardPanelPropertiesEdit_Iframe"]')
    .getByRole('button', { name: 'Save' })
    .click();
  await page1.getByRole('cell', { name: 'Approvers' }).click();
  await page1
    .frameLocator('iframe[name="WizardPanelPropertiesEdit_Iframe"]')
    .frameLocator('#UserFinderFrame')
    .locator('input[type="checkbox"]')
    .check();
  await page1
    .frameLocator('iframe[name="WizardPanelPropertiesEdit_Iframe"]')
    .getByRole('button', { name: 'Save' })
    .click();
});

Describe the bug

NOTICE - The password for this test is missing. Upon request, I can privately message it to whomever will be reviewing this issue. As per the request on this issue and this issue, I am opening a new issue. When running tests in Firefox, I am getting the following error: TypeError: Cannot read properties of undefined (reading 'childFrames')

I tried using next 1.28.0 which purportedly fixed it, but it still seems to be ran issue.

eatonjl avatar Oct 28 '22 20:10 eatonjl

@eatonjl can you please send the password privately to me at [email protected] ?

aslushnikov avatar Nov 02 '22 22:11 aslushnikov

@aslushnikov I sent it.

eatonjl avatar Nov 03 '22 13:11 eatonjl

I can reproduce it. When running under VS Code the browser closes after await page1.getByRole('cell', { name: 'Reviewers' }).click();

yury-s avatar Nov 10 '22 00:11 yury-s

Still got the issue on Playwright Python 1.28 Firefox

  1. image

  2. Sometime the log only show Frame got detach

after click button submit iframe.type("#input2", 'myvalue!', delay=100) self.enter() // then redirect to another page called pageX self.wait_element_loading("text=Value on ", 5000) // text on pageX

ninhlt avatar Nov 23 '22 15:11 ninhlt

@dgozman and @aslushnikov is there any update on this issue that you are able to share?

eatonjl avatar Dec 12 '22 21:12 eatonjl

@eatonjl we debugged the root cause of this issue to an incorrect juggler event instrumentation in firefox but were not able to come up with a legit fix so far.

aslushnikov avatar Dec 12 '22 22:12 aslushnikov

@aslushnikov thank you for the update! We are excited for when this is fixed and we can begin testing on Firefox.

eatonjl avatar Dec 13 '22 14:12 eatonjl

Should be fixed in the future by #20271.

dgozman avatar Jan 23 '23 17:01 dgozman

@dgozman Thank you for the update!

eatonjl avatar Jan 23 '23 17:01 eatonjl

@dgozman What version is this fix being applied to?

eatonjl avatar Feb 06 '23 20:02 eatonjl

@eatonjl Should be in v1.31.

dgozman avatar Feb 06 '23 20:02 dgozman

@dgozman Thank you!

eatonjl avatar Feb 06 '23 20:02 eatonjl

@eatonjl we would also appreciate if you try it out using @playwright/test@next!

aslushnikov avatar Feb 06 '23 22:02 aslushnikov

@dgozman How do I call that from the terminal?

eatonjl avatar Feb 07 '23 18:02 eatonjl

@eatonjl you can install canary version as npm i @playwright/test@next. It should update your package.json. See also https://playwright.dev/docs/next/canary-releases

aslushnikov avatar Feb 07 '23 18:02 aslushnikov

@aslushnikov Thank you for confirming. I thought it was that but I get "Error: ENOENT: no such file or directory, uv_cwd" when I try it. I will look around and see what is wrong with my build.

eatonjl avatar Feb 07 '23 18:02 eatonjl

@aslushnikov Please disregard. I got it working. I had to completely close out and reopen VSCode to get it to work. Thank you! I will begin testing.

eatonjl avatar Feb 07 '23 18:02 eatonjl

@dgozman I gave it a try. I think the issue is fixed, but there is now a problem where reloading the page times out and fails. Would you like me to create a new issue for it, even thought it is still in canary?

eatonjl avatar Feb 08 '23 14:02 eatonjl

@eatonjl Yep, a new issue with a repro would be great! It seems like your scenarios have the best coverage for Firefox 😄

dgozman avatar Feb 08 '23 17:02 dgozman