MarketSquare / MarketSquare/robotframework-browser

Add missing actionability options: `position_x`/`position_y`/`trial` on `Check Checkbox`/`Uncheck Checkbox`, `force` on `Clear Text` and `Select Options By`

Open
#5,098 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

## Use case

Several element-interaction keywords expose fewer of Playwright's actionability options than their siblings, which surprises users and forces JavaScript workarounds:

- **Custom-styled checkboxes** often hide the real `` under a styled overlay. `Click With Options` and `Tap` let users click a specific point of the element (`position_x`/`position_y`) or dry-run the actionability checks (`trial`), but `Check Checkbox`/`Uncheck Checkbox` only accept `force`. When the input's center is covered but an edge is clickable, users today must give up on the semantic checkbox keywords and fall back to `Click With Options` — losing the built-in checked-state handling.
- **`Clear Text` and `Select Options By` have no `force` argument at all**, although nearly every other interaction keyword (`Click`, `Check Checkbox`, `Hover`, `Tap`, …) has one. When a field or select is technically actionable but Playwright's checks disagree (transient overlays, exotic widgets), there is currently no escape hatch for these two keywords.

This is a consistency gap: the options exist in Playwright for all of these actions; the library simply does not forward them.

## Proposed keyword / arguments

All new arguments are named-only with behavior-preserving defaults.

`Check Checkbox` and `Uncheck Checkbox` gain (matching the existing `Tap` signature):

- `position_x: int | None = None`, `position_y: int | None = None` — point to click relative to the element's top-left corner.
- `trial: bool = False` — perform only the actionability checks, skip the actual action.

`Clear Text` and `Select Options By` gain:

- `force: bool = False` — bypass the actionability checks.

```robotframework
# Styled checkbox whose real input is covered except at its top-left corner
Check Checkbo    id=terms position_x=2 position_y=2
Uncheck Checkbox id=terms position_x=2 position_y=2

# Only verify the checkbox is actionable, without changing its state
Check Checkbox id=terms trial=True

Clear Text id=search-input force=True
Select Options By select[name=channel] label Direct mail force=True
Get Checkbox State id=terms == checked
```

## Playwright API

- [`locator.check`](https://playwright.dev/docs/api/class-locator#locator-check) / [`locator.uncheck`](https://playwright.dev/docs/api/class-locator#locator-uncheck) — options `position` and `trial`.
- [`locator.clear`](https://playwright.dev/docs/api/class-locator#locator-clear) — option `force`.
- [`locator.selectOption`](https://playwright.dev/docs/api/class-locator#locator-select-option) — option `force`.

## Implementation notes

- `protobuf/playwright.proto`: the checkbox RPCs currently use `ElementSelector` with a `force` flag; they need either an options-JSON request (like `Click`'s `ElementSelectorWithOptions`) or added fields. `Clear Text` / `SelectOption` requests need a `force` flag.
- `node/playwright-wrapper` interaction handlers: forward `position`, `trial`, `force` to the corresponding locator calls.
- `Browser/keywords/interaction.py`: extend `check_checkbox`, `uncheck_checkbox`, `clear_text`, `select_options_by` signatures (named-only). Note `select_options_by` uses `*values`, so `force` must be keyword-only after it.
- Docs and atest cases (a covered-checkbox fixture may need to be added to the test app).

## Backwards compatibility

All arguments are new and named-only with defaults (`None`/`False`) that reproduce the current behavior exactly; no existing suite is affected.

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.

Research direction

Start with the checkbox and interaction requests in protobuf/playwright.proto, then trace their handlers in node/playwright-wrapper and the keyword signatures in Browser/keywords/interaction.py. Review the existing Click options, atest cases, and documentation patterns before adding the named-only options. Done means all four keywords forward the requested options while preserving defaults, with coverage for checkbox positioning/trial and force behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
playwright, python
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.