Skip to content

"Get BoundingBox" fails if element is not visible, wo proper error. #3651

Closed
@Andre-A-AtGithub

Description

@Andre-A-AtGithub

Describe the bug
Using FOR loop to iterate "Elements" "Get BoundingBox" gives error.

This worked before when using "older" versions. After updating to latest version of Python, Robot framework, Browser, etc this issue arose. See below overview of exact "old" and "new" versions:

Python: 3.9 → 3.12
Robotframework: 4.1.1 → 7.0
Robotframework-browser: 8.0.2 → 18.5.1

For more information see Robot framework Slack: https://robotframework.slack.com/archives/C015KB1QSDN/p1717657032495999

Print screen of debug log
image

To Reproduce
Environment:
This mainly happens in the test auto test framework I use, it is for me not certain if this also occurs in other setups.

Steps to reproduce the behavior:

  1. Run "Get Elements" in a way it gives more than 1 results
  2. Use FOR loop to iterate the elements to find the boundingbox of the elements
  3. When the list of elements contains more than 1 element in the list than there is a error: TypeError: 'NoneType' object is not iterable". I also added a image of the error.

Relevant code in our test framework:
${elements}= Get Elements ${selector}
FOR ${element} IN @{elements}
${box}= Get BoundingBox ${element}
IF ${box}
Append To List ${bounded_elements} ${element}
END
END
RETURN ${bounded_elements}

Expected behavior
That it iterates all elements that are in the list

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10/11 (both give same issue)
  • Browser: Chrome
  • Version: 125.0.6422.26 (developer build) (64-bits)

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions