MarketSquare / MarketSquare/robotframework-browser

Get Element By Role does not work when searching by Name when the Role is definition.

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

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:

Image

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
Image

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.