MarketSquare / MarketSquare/robotframework-browser
Add `location` key (url, line, column) to `Get Page Errors` entries
@Snooz82 is already working on this.
Since Aug 6, 2026.
- Dominant language
- Python
- Stars
- 655
- Forks
- 147
- Avg merge
- 5h 27m
- Merged PRs (30d)
- 59
Description
Use case
Get Page Errors returns accumulated uncaught page errors, but pinpointing which script threw currently means parsing the free-form stack trace string — brittle and different per browser. Playwright 1.60 introduced the weberror context event, whose WebError carries a structured source location. Surfacing it lets users assert directly on the offending script URL, line and column, e.g. to verify a third-party script is (or is not) the source of console errors, without any string parsing. Today no structured alternative exists.
Proposed keyword / arguments
No new keyword and no signature change — each dict in the list returned by Get Page Errors gains a key:
location— dict{url, line, column}of the error source (may be empty/Nonewhen the browser does not report a location)
*** Test Cases ***
Error Comes From Our Bundle Not The Ad Script
New Page ${TEST_APP_URL}/broken
Click id=trigger-error
${errors}= Get Page Errors
Should Contain ${errors[0].location.url} /static/app.bundle.js
Should Be True ${errors[0].location.line} > 0
The existing assertion-engine arguments of Get Page Errors keep working as before.
Playwright API
webError.location (v1.60), delivered via the browserContext.on('weberror') event.
Implementation notes
node/playwright-wrapper/playwright-state.ts: the page-error accumulator currently feeds from the page-levelpageerrorevent; switch (or augment) capture to the context-levelweberrorevent so thelocationobject is available, attributing each error to its page viawebError.page(), and storelocationalongside the existing fields.Browser/keywords(get_page_errors): document the newlocationkey. No proto changes expected — the entries already travel as JSON.- atest: test-app page that throws from a known script/line; assert on
location.url/line.
Backwards compatibility
Fully additive: the entry dicts only gain a location key; existing keys, ordering and the keyword signature are unchanged. Suites asserting on the message/stack text keep working.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.