How do I get Selenium WebDriver to work for many hours (CHO) without having a crash / OutOfMemory?

I use selenium-2.30.0 to run a single test (on windows) that runs for many hours (~ 8 hours). I used the FF driver, but it only runs out of memory after 45 minutes or less, and the test just hangs. I was not able to use HTMLUnitDriver (I thought the solution with pure java was the answer) to work the same as the FF driver (since it needs to wait for the page to load, and I definitely did not want to put random threads in my code or implement any new feature by extending HTMLUnitDriver).

  • I can not break the test case into several smaller units.
  • I cannot reload the driver as I see excessive memory usage.

Is there any way to make this work?

+5
source share
3 answers

I found this link: creating-firefox-profile-for-your-selenium-rc-tests and was quite useful. Created a new firefox profile with absolute minimal settings, and the test worked without problems for the past 4 hours. Thanks so much for helping the guys!

+3
source

What kind of testing are you doing? Selenium is mainly used for acceptance testing. It looks like what you are trying to do is more like an aging test on your system.

, JMeter, . , JMeter HTTP (HTTP Request), Selenium HTML.

+1

What is crashing, your test Java code, or Firefox itself? If this is Java test code, are you sure you're not a memory leak? Or perhaps a server side memory leak?

-1
source

All Articles