Is it possible to use already running firefox instance?

43 views
Skip to first unread message

Bkumar

unread,
Nov 17, 2013, 9:27:46 AM11/17/13
to clj-we...@googlegroups.com
Hi,

I am planning to run bunch of scripts using clj-webdriver (with firefox browser). I use linux (no GUI), so xvfb is used to run firefox in head less mode.

I have (set-driver! {:browser :firefox}) in my scripts, which actually starts a firefox instance. I am wondering if it is possible to tell web driver to use existing firefox instance instead of starting new one?
If not possible, is there any work around?

Thanks for your time.

-Bkumar

semperos

unread,
Aug 15, 2015, 8:40:37 AM8/15/15
to clj-webdriver
I apologize for the incredibly late response to this.

No, as far as I am aware it is not possible to attach to an instance of Firefox that Selenium-WebDriver itself didn't start up.

One reason to _want_ to do this is to use your personal Firefox, for example, with all its settings and plugins installed. Selenium-WebDriver Firefox support allows enabling plugins that you have installed as well as a number of other things. So you might look in that direction if you need more than the bare-bones Firefox profile that Selenium-WebDriver boots up by default.

Otherwise, if you're experiencing problems with the time it takes to open and close your browser, then I find it helps to write your tests such that your browser(s) stay open for as long as possible, and you simply write test fixtures to bring the browser back to some clean/default state for each test in your suite.

-Daniel
Reply all
Reply to author
Forward
0 new messages