Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looping over Elements and performing actions gets exponentially slower as the list grows (Java binding web driver 2.45.0) #390

Closed
MChiciak opened this issue Mar 31, 2015 · 1 comment

Comments

@MChiciak
Copy link

Version: 2.45.0
Bindings: Java
Browser: Chrome/FF

While the findElementsBy function takes only mere seconds to return a record set, selenium slows down at an exponential rate when performing actions on the record set.

Case in point, I have to loop over 1000 elements and perform a click on each. The findElementsBy function only takes 6 seconds to get all 1000 WebElements, however, looping over each and performing a click takes hours and gets exponentially slower as the iterator processes.

It seems there is a memory leak issue here because even simply grabbing the first element in the list and performing a click on just that element takes 30+ seconds.

When doing a singular findElementBy().click(), the action performs instantly.

I also performed a test by looping over each and simply outputting getText(). You can see as the iterator moves through that each subsequent iteration is twice as slow as the previous.

I also performed another test by getting my 1000 elements. But then I simply called findElement singular again to grab the first element and performed a click. The click still took 30+ seconds. So it seems as though there is definitely a memory issue here.

@lukeis
Copy link
Member

lukeis commented Mar 31, 2015

Please provide a sample html page and corresponding script. Along with which OS platforms and browser versions you are seeing this on and then we can reopen your issue.

@lukeis lukeis closed this as completed Mar 31, 2015
@lock lock bot locked and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants