How to restart webkit browser

418 views
Skip to first unread message

Alexander Simonov

unread,
Dec 26, 2012, 3:30:59 AM12/26/12
to capybar...@googlegroups.com
Hello,

I need restart browser. poltergeist have this feature, but i didn't find it in capybara-webkit.
I found only reset! call but it not restart browser. It send some 'reset' but i'm not sure what it helps me to free memory from the browser.
My issue in crashing browser  after 10000(approximately) opened pages.

Joe Ferris

unread,
Jan 3, 2013, 1:43:17 PM1/3/13
to capybar...@googlegroups.com
Hey Alexander,

We don't currently have a command for this. Are you experiencing this problem in tests, or are you using capybara for scraping in production?

-Joe

Alexander Simonov

unread,
Jan 3, 2013, 1:45:48 PM1/3/13
to capybar...@googlegroups.com
I'm using capybara for scraping.
Just now I made next:
After 1000 request i rerun script with latest url and detach process and old one dying. But i suppose this is not good solution.
Better to have command what will restart webkit_server.

Joe Ferris

unread,
Jan 3, 2013, 1:52:08 PM1/3/13
to capybar...@googlegroups.com
That's an odd case for us, as we're focused on using it for testing.

Some possibly useful information for your case:

* Capybara::WebKit::Connection is the class responsible for starting and stopping the server.
* Connection has a private method called "kill_process" that will shut down the current server.
* You could potentially change Connection to have a public "restart" method to cycle the process. Assuming it didn't introduce a significant maintenance burden, we'd take a tested, well-factored patch to add the method.

If you don't feel like submitting a patch and just wand a workaround, you can try calling the private "kill_process" method and starting a new capybara session.

-Joe
Attachments:
- smime.p7s

Alexander Simonov

unread,
Jan 3, 2013, 4:28:47 PM1/3/13
to capybar...@googlegroups.com
Thank you for you help!
Reply all
Reply to author
Forward
0 new messages