playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] [Firefox] Protocol error is thrown when interacting with iframe elements

Open AntonStriga opened this issue 2 years ago • 8 comments

Context:

  • Playwright Version: 1.27.1
  • Operating System: Windows 10
  • Node.js version: v16.16.0
  • Browser: Firefox
  • Extra: [any specific details about your environment]

Describe the bug

  1. There is page with iframe.
  2. Frame is detected by frameLocator: this.frameLocator = page.frameLocator('.module-frame')
  3. Test interacts with elements of the frame
  4. On the step with file downloading (by clicking on button) Print preview modal appears
  5. Interaction with page elements inside iframe is crashed

Error: locator.click: Protocol error (Page.describeNode): error in channel "content::11/12/5": exception while running method "describeNode" in namespace "page": Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDocShell.domWindow] domWindow@chrome://juggler/content/content/FrameTree.js:573:5 _describeNode@chrome://juggler/content/content/PageAgent.js:442:30 _onMessage@chrome://juggler/content/SimpleChannel.js:194:37 bindToActor/actor.receiveMessage@chrome://juggler/content/SimpleChannel.js:53:44 _onMessage@chrome://juggler/content/SimpleChannel.js:178:24 bindToActor/actor.receiveMessage@chrome://juggler/content/SimpleChannel.js:53:44

at ConfirmationButtons.cancel (file:///e:/WORK/repository/nsms_tests/e2e/src/appUI/commonElements/modalButtons.ts:48:30) at CustomDownloadDialog.cancel (file:///e:/WORK/repository/nsms_tests/e2e/src/appUI/commonElements/dialogs.ts:42:28) at Clients.createDstByDetailsDropDown (file:///e:/WORK/repository/nsms_tests/e2e/src/appUI/nsms/clients/clients.ts:225:9) at file:///e:/WORK/repository/nsms_tests/e2e/src/tests/role-model/vpn/test.spec.ts:32:9

Execution log waiting for frame ".module-frame" selector resolved to visible <iframe _ngcontent-ckx-c345="" class="module-frame ng-st…>

Note In chromium browser this problem is absent. Tests work correctly.

AntonStriga avatar Nov 28 '22 13:11 AntonStriga

Could you share an example we can use to reproduce this problem?

pavelfeldman avatar Nov 28 '22 20:11 pavelfeldman

You can reproduce bug using the following files: html_frame.zip

import { test } from '@playwright/test'
test("test iframe", async ({page}) => {
    await page.goto("http://127.0.0.1:8080")
    const frame = page.frameLocator('#ind_frame')
    const input = frame.locator('#input')
    const button = frame.locator('#button')

    await input.fill("test text")
    await button.click()
    await input.fill("after using print button")
        
    await page.waitForTimeout(5000)
})

Note: I've tried downgrade playwright version: on 1.26.1 Bug is not reproduce

AntonStriga avatar Nov 30 '22 08:11 AntonStriga

I can repro.

mxschmitt avatar Dec 01 '22 21:12 mxschmitt

Faced the same issue.

niyarlatotep avatar Dec 02 '22 14:12 niyarlatotep

@dgozman Why is this tagged as collecting-feedback isn't it a bug? It worked well in old versions e. g. 1.26.1.

niyarlatotep avatar Dec 02 '22 14:12 niyarlatotep

@dgozman Why is this tagged as collecting-feedback isn't it a bug? It worked well in old versions e. g. 1.26.1.

This involves print preview, which is not the top priority for Playwright project. I haven't noticed this is a regression from 1.26.1 though, let me take a closer look.

dgozman avatar Dec 02 '22 15:12 dgozman

Any chance to get it fixed?

niyarlatotep avatar Dec 06 '22 16:12 niyarlatotep

This involves print preview, which is not the top priority for Playwright project

We don't need to interact with print preview itself. But after it appears it breaks iframe locators and all interactions with elements inside iframe are impossible.

AntonStriga avatar Dec 12 '22 08:12 AntonStriga

I faced same issue. I need solution . Did anyone solved this issue ? I’m ready to pay for the solution

unlimdwl avatar Apr 07 '23 18:04 unlimdwl

Why was this issue closed?

Thank you for your contribution to our project. This issue has been closed due to its limited upvotes and recent activity, and insufficient feedback for us to effectively act upon. Our priority is to focus on bugs that reflect higher user engagement and have actionable feedback, to ensure our bug database stays manageable.

Should you feel this closure was in error, please create a new issue and reference this one. We're open to revisiting it given increased support or additional clarity. Your understanding and cooperation are greatly appreciated.

pavelfeldman avatar Nov 17 '23 00:11 pavelfeldman