1

I need to work with a very huge page (there are a lot of elements, really) with selenium and Chromedriver. After navigation happened and page loaded test gets hung for more than 2 hours. Chrome is consuming 100 % CPU during this process. I suspect it to parse the loaded page.

Is there a way to avoid or handle it somehow? (I know that the page should not be that huge, but it is a different story)

Thanks in advance for your help.

Atomikin
  • 73
  • 5
  • Page is loaded an the test case is hanging? What does the test actually do with the page? Can you please post the relevant test code? – Würgspaß Oct 07 '15 at 14:12
  • What line of code does the test get bogged down on? Can you give a code snippet or a link to the page as something for answers to work with? Also, a possibly related question: [Chromedriver extremely slow](http://stackoverflow.com/questions/16179808/chromedriver-is-extremely-slow-on-a-specific-machine-using-selenium-grid-and-ne) – Kyle Pittman Oct 07 '15 at 14:12
  • That's the point that it does nothing. It clicks web element (link) and navigation happens to this page with huge number of elements. And that's all. I tried the same on different test env where the page has normal number of elements and it works just fine. – Atomikin Oct 07 '15 at 15:03
  • Is it chrome related problem? How fast does your case work in Firefox? – Mesut GUNES Oct 07 '15 at 15:19
  • We are not using FF, though I tried in IE9 and it also hung on this page. I took a look at IE driver logs and there are lots of records like this: `T 2015-10-07 06:18:51:703 IECommandExecutor.cpp(189) Entering IECommandExecutor::OnGetResponseLength`. – Atomikin Oct 07 '15 at 15:37

2 Answers2

0

Use HTMLUNIT or any headless automation tool .. But that's too have some limitation.

You can refer:- https://skillsmatter.com/skillscasts/5067-what-is-headless-automation-why-tools-benefits

http://www.toolsqa.com/selenium-webdriver/headless-browser-testing-selenium-webdriver/

Hope it will help you :)

Shubham Jain
  • 16,610
  • 15
  • 78
  • 125
0

All, thanks for your help. I found the root cause. Actually the problem was with non optimal usage of find_elements. Even when it is called once it executes for ages. Replaced with a workaround using find_element and it started to work. The workaround is fragile, but it's better than nothing.

Mosam Mehta
  • 1,658
  • 6
  • 25
  • 34
Atomikin
  • 73
  • 5