Skip to content

[pull] main from microsoft:main#770

Merged
pull[bot] merged 2 commits into
code:mainfrom
microsoft:main
Jun 11, 2026
Merged

[pull] main from microsoft:main#770
pull[bot] merged 2 commits into
code:mainfrom
microsoft:main

Conversation

@pull

@pull pull Bot commented Jun 11, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

SebTardif and others added 2 commits June 11, 2026 11:47
… button (#41244)

When a page uses a hidden `<input type="file">` triggered by another element:

```html
<button onclick="document.querySelector('input[type=file]').click()">select file</button>
<input type="file" style="display: none">
```

codegen recorded the `setInputFiles` action with the **button's** selector (from `_hoveredModel`, which points to the last visible element the mouse was over) instead of the actual file input's selector. The generated code:

```js
// BUG: button is not an HTMLInputElement
await page.getByRole('button', { name: 'select file' }).setInputFiles('filename');
```

fails at runtime with `locator.setInputFiles: Error: Node is not an HTMLInputElement`.

The fix: when the `input` event target (the file input element) differs from `_hoveredElement` (the last mouse-hovered element), derive the selector directly from the target via `generateSelector` instead of reusing the hover model. For visible file inputs where the user directly hovers and clicks, `target === _hoveredElement` so existing behaviour is preserved.

Fixed output:
```js
await page.getByRole('button', { name: 'select file' }).click();
await page.locator('input[type="file"]').setInputFiles('filename');
```

Fixes #41239
@pull pull Bot locked and limited conversation to collaborators Jun 11, 2026
@pull pull Bot added the ⤵️ pull label Jun 11, 2026
@pull pull Bot merged commit 95460e4 into code:main Jun 11, 2026
@pull pull Bot requested a deployment to allow-uploading-flakiness-results June 11, 2026 23:32 Queued
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot had a problem deploying to allow-uploading-flakiness-results June 11, 2026 23:32 Failure
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot had a problem deploying to allow-uploading-flakiness-results June 11, 2026 23:32 Failure
@pull pull Bot had a problem deploying to allow-uploading-flakiness-results June 11, 2026 23:32 Failure
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot had a problem deploying to allow-uploading-flakiness-results June 11, 2026 23:32 Failure
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot had a problem deploying to allow-uploading-flakiness-results June 11, 2026 23:32 Failure
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot had a problem deploying to allow-uploading-flakiness-results June 11, 2026 23:32 Failure
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot had a problem deploying to allow-uploading-flakiness-results June 11, 2026 23:32 Failure
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
@pull pull Bot temporarily deployed to allow-uploading-flakiness-results June 11, 2026 23:32 Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants