简体   繁体   English

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

[英]Selenium v2: use current browser session

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. 我在这里看到了以前的类似问题,但是v2已发布。

The Selenium Webdriver protocol allows uploading a Firefox profile that should be used for the test session. Selenium Webdriver协议允许上传应用于测试会话的Firefox配置文件。 You need to send a zipped and base64-encoded profile data folder to Selenium. 您需要将压缩的和base64编码的配置文件数据文件夹发送到Selenium。 Here's some information on how to achieve this using the Facebook php-webdriver. 以下是有关如何使用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. 如果需要安装某些证书:这些是用户配置文件中一个名为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. 如果您创建的用户配置文件已安装了证书,则可以按照上述指南将其用于Selenium测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM