Selenium Server error: Unable to get browser

南笙酒味 提交于 2019-12-03 12:42:37

问题


I'm running Selenium Standalone Server 2.25 on Windows 7, with Internet Explorer 9 as a browser, and I'm getting this error for every test that requires opening the browser:

Selenium::WebDriver::Error::UnknownError:
       Unable to get browser (WARNING: The server did not provide any stacktrace information)
       Command duration or timeout: 10 milliseconds
       Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 21:08:56'
       System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_07'
       Driver info: driver.version: EventFiringWebDriver
       Session ID: 356e9fc8-2d2b-4808-964c-4a1fea7415f9 (org.openqa.selenium.WebDriverException)

What am I doing wrong? The exact same information appears on the Selenium Server console.


回答1:


The error disappeared after enabling the Protected Mode settings for all the zones in Internet Explorer (Tools > Internet Options > Security tab).




回答2:


For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates.

For 32-bit Windows installations, the key you must examine in the registry editor is

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE

For 64-bit Windows installations, the key is

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE

Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0

Download the registry file from http://heliumhq.com/docs/internet_explorer.

See https://code.google.com/p/selenium/wiki/InternetExplorerDriver for this and more necessary IE configuration steps.




回答3:


My usual tactic is to individually add sites that require automated testing to 'trusted sites' in IE.

Go to Tools > Internet Options > Security then click Trusted Sites and the Sites button and individually add the website(s) needed.

Probably easier to get past your IT manager that way if you're locked down.




回答4:


I'm using Selenium at Eclipse and my solution for this trouble is run IDE as administrator




回答5:


i have added the url which i am trying to access in the Trusted Sites that way it worked for me after trying all the turnarounds




回答6:


You must try this...

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();

capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
System.setProperty("webdriver.ie.driver",IE_DRIVER_PATH);
driver = new InternetExplorerDriver(capabilities);


来源:https://stackoverflow.com/questions/12694001/selenium-server-error-unable-to-get-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!