question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get Elements keyword returning 0 because it does not wait element attached state.

See original GitHub issue

Describe the bug When searching a webpage for multiple elements of the same type (e.g. checkbox) to use in a random selector we get the error 0 elements of type =checkbox. But when we us Get Element with the same search criteria we get the error found 3 elements of type checkbox

To Reproduce Steps to reproduce the behavior:

  1. Search a webpage that has multiple elements/attributes of the same type
  2. Using Get Elements try to get them to return as a list
  3. Get the error 0 elements of type =<what you are searching for>

Expected behavior This works in version 6.0.0 which was the version we have been using from August until October (upgraded to 10.0.1 on Nov 1st) Expecting the Get Elements keyword to return a list of elements of the given type which will allow us to use these in the further steps of our test e.g. Click a random checkbox from the returned list

Desktop (please complete the following information):

  • OS: MacOS 11.6
  • Chrome
  • Version 95.0.4638.54
  • RobotFramework Version 4.1.2

Additional context As we are automating an internal web application I am not able to supply links or snippets of code due to security constraints. But please let me know if there is anything I can add here that could help with this issue

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
allcontributors[bot]commented, Nov 5, 2021

@aaltat

I’ve put up a pull request to add @GavinRodgers-EN0055! 🎉

0reactions
aaltatcommented, Nov 5, 2021

Ah, I think I know what is wrong, before 10.x release, Get Element(s) keywords did wait that at least one element is in attached state. But in 10.x release we do not anymore wait that and this is a regression bug.

Need to think how to reproduce the problem and fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Robotframework: Selenium2Lib: Wait Until (...) Keywords
Wait Until Page Contains Element makes no assumptions about the element. It waits until the element is actually on the page, regardless if...
Read more >
StaleElementReferenceException with Wait* keywords #475
Documentation says that keyword should only fail if condition is not met before the timeout, example for Wait Until Page Contains Element keyword,...
Read more >
SeleniumLibrary - Robot Framework
SeleniumLibrary is a web testing library for Robot Framework. This document explains how to use keywords provided by SeleniumLibrary.
Read more >
Browser - MarketSquare
If keyword does not state that strict mode is used, ... If there is none, wait until a matching element is attached to...
Read more >
webdriver - "Element is no longer attached to the DOM ...
When the test runs, I can see the row become highlighted as if it is clicked, but then immediately I get the "org.openqa.selenium.StaleElementReferenceException ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found