robotframework / robotframework/SeleniumLibrary

Feature Request - New keyword to perform operation elements returning from Get Webelements

Open
#1,534 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement priority: medium
Dominant language
Python
Stars
1.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

Can we have a keyword wrapped around Get Web Elements which will do operations on the list return by this? For example, If in an application I filtered a column and want to verify if the results are there in each row I can simply do below:

@{elList} = Get webelements ${OR_CELL_TO_CHECK}
:FOR ${item} IN @{elList}
${textOfAcc}= Get Text ${item}
Should Be Equal ${textOfAcc} ${SHOULD_CONTAINS}
END

We can have multiple keywords using this like:
Get elements and verify the text
Get elements and verify attribute
Get elements and verify does not contains text

For elements with text we can still use Page Should Contains Text with limit argument as suggested by @aaltat in another thread but I would still feel attribute checks are required some time and we should have a list of keywords to deal with it.

Thanks!

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 by reviewing the existing Get Web Elements keyword and the discussion in issue 315, then compare the proposed loop with current SeleniumLibrary keyword patterns. Done would mean a decided, documented scope for list-based text and attribute checks, with behavior covering the requested examples and appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.