MarketSquare / MarketSquare/robotframework-browser

Add `url` key to the `DownloadInfo` dict returned by download keywords

Open
#5,108 0 comments 0 reactions 1 assignee View on GitHub

@Snooz82 is already working on this.

Since Aug 6, 2026.

enhancement
Dominant language
Python
Stars
655
Forks
147
Avg merge
5h 27m
Merged PRs (30d)
59

Description

## Use case

`Download`, `Promise To Wait For Download` and `Get Download State` return a `DownloadInfo` dict with `saveAs`, `suggestedFilename`, `state` and `downloadID` — but not the **URL the download originated from**. Verifying that a download came from the expected URL is a common real-world assertion: as a security/regression check, or on pages where multiple links can trigger downloads and the suggested filename alone does not disambiguate them. Today there is no way to get this information; Playwright has it readily available as `download.url()` on the `Download` object the wrapper already holds.

## Proposed keyword / arguments

No new keyword and no signature change — the `DownloadInfo` dict simply gains a key:

- `url` — the URL the download originated from

```robotframework
*** Test Cases ***
Report Download Comes From Expected Endpoint
New Context acceptDownloads=True
New Page ${TEST_APP_URL}
${dl_promise}= Promise To Wait For Download saveAs=${OUTPUT_DIR}/report.pdf
Click id=download-report
${file}= Wait For ${dl_promise}
Should Contain ${file.url} /api/reports/
Should Be Equal ${file.state} finished
```

## Playwright API

[`download.url`](https://playwright.dev/docs/api/class-download#download-url) — returns the URL of the downloaded file.

## Implementation notes

- `node/playwright-wrapper`: include `download.url()` in the serialized download info wherever `DownloadInfo` responses are built (the `Download` object is already in hand at those points). No new proto RPC; at most an added field in the existing JSON payload.
- `Browser/utils/data_types.py`: add `url` to the `DownloadInfo` TypedDict and its documentation table.
- `Browser/keywords`: keyword docs of `Download`, `Promise To Wait For Download`, `Get Download State` mention the new key.
- atest: assert the `url` key against the test app's download endpoint.

## Backwards compatibility

Fully additive: no signature changes, only a new key in the returned dict. Existing suites reading `saveAs`, `suggestedFilename`, `state` or `downloadID` are unaffected.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.