Hi, I'm having the same problem.
In my case, open and close the phantomjs more than 300 times in a single
process.
I open and close because they are a lot of requests in Ajax, and sometimes
overload the memory. So I always run:
@browser.close if defined? @browser
@headless.destroy if defined? @headless
http_driver = Selenium::WebDriver.for :phantomjs, :desired_capabilities
=> Selenium::WebDriver::Remote::Capabilities.phantomjs(
"phantomjs.page.settings.userAgent" => HTTP_USER_AGENT
)
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = HTTP_CLIENT_TIMOUT
@browser = Watir::Browser.new http_driver, :http_client => client
The problem only happens sometimes, I guess that is a failure due to the amount
of open processes phantomjs.
Is there any way to clear the memory of phantomjs without having to recharge it?
---
Reply to this email directly or view it on GitHub:
https://github.com/watir/watir-webdriver/issues/222#issuecomment-27771883_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development