Selenium v​​2:使用当前的浏览器会话

How can I reuse current browser window and session?

Authorization is made by smart-card with certificate, so I can't use blank browser to test the application.

I saw previous similar questions here, but v2 has released.

The Selenium Webdriver protocol allows uploading a Firefox profile that should be used for the test session. You need to send a zipped and base64-encoded profile data folder to Selenium. Here's some information on how to achieve this using the Facebook php-webdriver.

This could be a way to use some special preparation for your test browser.

If you need certain certificates to be installed: these are part of the user profile in a file called cert8.db. If you've created a user profile that has the certificates installed, you can follow the above guide to use it for your Selenium tests.