MarketSquare / MarketSquare/robotframework-browser
Get Element By Role does not work when searching by Name when the Role is definition.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 655
- Forks
- 147
- Avg merge
- 5h 38m
- Merged PRs (30d)
- 58
Description
Describe the bug
According to the documentation of the keyword (https://marketsquare.github.io/robotframework-browser/Browser.html#Get%20Element%20By%20Role), this should work:
${definition} Get Element By Role definition name=Uw referentie
This is the info for the intended webelement to find:
However, each time I try any variation of finding this element, it will not be found.
Short selection of tried variations:
${definition} Get Element By Role definition name=Uw referentie exact=false
${definition} Get Element By Role definition all_elements=True name=Uw referentie
As alternative I even tried using keyword "Click":
Click internal:role=definition[name="Uw referentie"]
To Reproduce
Steps to reproduce the behavior:
There is a combination of dd/dt on the webpage.
And the dd has role definition.
Name should be of the dt.
And there is also a aria-labelledby element.
Expected behavior
${definition} Get Element By Role definition name=Uw referentie
Should result in a found element.
Screenshots
Desktop (please complete the following information):
- OS: Linux-based docker-image
- Browser: Chromium
- Python version: python:3.14-slim-bookworm
- Version: robotframework-browser 20.4.0. RF version 7.4.2, upgraded to RF version 7.5, problem still occurres.
Smartphone (please complete the following information):
- N/A
Additional context
Developer indicated that using Playwright .getByRole directly does not give any problems.
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.
Research direction
Start at the Get Element By Role keyword and compare its role and name handling with Playwright's getByRole behavior. Reproduce the dd/dt case with role=definition, name=Uw referentie, and aria-labelledby, then verify that the keyword finds the intended element without relying on the alternative Click selector.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- playwright, python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100