Skip to content

[Bug]: Iframe contents not accessible when accessing PowerApps page via CDP Connection #36095

Closed

Description

@Skn0tt

Version

ToT

Steps to reproduce

  1. Open Browser with CDP on port 5123
  2. In the browser, open https://apps.powerapps.com/play/e/default-33efaf18-cebe-428d-9964-79593592b653/a/adc30f26-b653-4e67-b768-00b067d3ea29?tenantId=33efaf18-cebe-428d-9964-79593592b653&hint=16ee690b-d8d7-488a-b712-7b040e59fc1c&sourcetime=1748272776074&source=portal and login with credentials shared privately
  3. Run this test:
it('repro', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright-mcp/issues/447' } }, async ({ playwright }) => {
  const browser = await playwright.chromium.connectOverCDP('http://localhost:5123');
  const page = browser.contexts()[0].pages()[0];
  // await page.reload(); // uncomment to make test pass
  await expect(page.frameLocator('#fullscreen-app-host').locator('#publishedCanvas')).toBeVisible();
});

Expected behavior

Test passes

Actual behavior

Test fails because it can't find element

Additional context

maybeFrame is null:

const maybeFrame = await frame._page.delegate.getContentFrame(element);

discovered via microsoft/playwright-mcp#447

Environment

System:
    OS: macOS 15.5
    CPU: (12) arm64 Apple M3 Pro
    Memory: 87.38 MB / 18.00 GB
  Binaries:
    Node: 23.11.0 - ~/.local/state/fnm_multishells/75674_1748270617142/bin/node
    npm: 10.9.2 - ~/.local/state/fnm_multishells/75674_1748270617142/bin/npm
    pnpm: 10.6.5 - /opt/homebrew/bin/pnpm
  IDEs:
    VSCode: 1.100.2 - /opt/homebrew/bin/code
  Languages:
    Bash: 3.2.57 - /bin/bash

Activity

  1. mxschmitt commented on Jun 16, 2025

    @mxschmitt
    Contributor

    Looks like #17656 - I can repro with this:

    it('should allow to re-connect to OOPIFs with CDP when iframes were there already', async ({ launchPersistent, browserType, server }) => {
      it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/36095' });
      const { context } = await launchPersistent({
        cdpPort: 9222,
      });
      await context.pages()[0].goto(server.PREFIX + '/dynamic-oopif.html');
    
      const browser = await browserType.connectOverCDP('http://localhost:9222');
      const page = browser.contexts()[0].pages()[0];
      await page.reload()
      expect(page.frames().length).toBe(2);
      await assertOOPIFCount(browser, 1);
      expect(await page.frames()[1].evaluate(() => '' + location.href)).toBe(server.CROSS_PROCESS_PREFIX + '/grid.html');
    
      await context.close();
    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions