使用Selenium Web驱动程序时如何在测试执行后保持浏览器打开

使用Selenium Web驱动程序时如何在测试执行后保持浏览器打开

问题描述:

我的脚本在浏览器的不同选项卡中搜索不同的字符串.有没有办法在测试执行结束后保持浏览器打开,以便以后可以检查结果?目前,即使我没有使用driver.quit(),浏览器也会在5分钟后自动关闭.

My script searches for different strings in different tabs of a browser. Is there a way to keep the browser open after test execution is over so that results can be checked at a later time? Currently the browser closes automatically after 5 mins even though i am not using driver.quit().

硒:2.33,Win 7,FF和Chrome

Selenium: 2.33, Win 7, FF and Chrome

我至少能够解决我的问题.我正在使用Remote Web Driver类,并且有一个选项可以在启动集线器时在命令行上提供超时和browser_timeout参数.将该值设置为0意味着集线器将无限期等待.对于这种情况,我只想要那个.

I was able to get the fix at least for my problem. I am using Remote Web Driver class and there is an option to provide timeout and browser_timeout parameters on the command line when the hub is started. Setting the value to 0 means the hub will wait indefinitely. For this scenario i wanted that only.