Windows 当作为本地系统用户运行时,selenium与chrome出现问题
3I正在使用selenium-server-standalone-2.33.0.jar启动selenium测试套件。我有一个测试套件,在firefox和Internet Explorer中运行得非常好。当我尝试在Google Chrome中运行它时,它对当前用户运行良好。当我尝试从本地系统用户运行测试(打开以本地系统用户身份运行的命令窗口)时,测试失败,并出现windows注册表异常。以下是我尝试运行的命令:Windows 当作为本地系统用户运行时,selenium与chrome出现问题,windows,selenium,windows-7,selenium-rc,local-system-account,Windows,Selenium,Windows 7,Selenium Rc,Local System Account,3I正在使用selenium-server-standalone-2.33.0.jar启动selenium测试套件。我有一个测试套件,在firefox和Internet Explorer中运行得非常好。当我尝试在Google Chrome中运行它时,它对当前用户运行良好。当我尝试从本地系统用户运行测试(打开以本地系统用户身份运行的命令窗口)时,测试失败,并出现windows注册表异常。以下是我尝试运行的命令: java -jar selenium-server-standalone-2.33.0
java -jar selenium-server-standalone-2.33.0.jar -port 5885 -htmlsuite "*googlechrome" "http://www.google.com" "TestSuite.html" "results.html"
这是我得到的一个例外:
HTML suite exception seen:
java.lang.RuntimeException: org.openqa.selenium.os.WindowsRegistryException: Problem while managing
the registry, OS Version '6.1', regVersion1 = false
Build info: version: '2.33.0', revision: '6c40c18', time: '2013-04-09 17:22:56'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_38'
Driver info: driver.version: unknown
at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.createBrowserLauncher(
BrowserLauncherFactory.java:175)
at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.getBrowserLauncher(Bro
wserLauncherFactory.java:109)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.getBrowserLauncher(HTMLLauncher.java:7
9)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:139)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:198)
at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:630)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:305)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:245)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:54)
Caused by: org.openqa.selenium.os.WindowsRegistryException: Problem while managing the registry, OS
Version '6.1', regVersion1 = false
Build info: version: '2.33.0', revision: '6c40c18', time: '2013-04-09 17:22:56'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_38'
Driver info: driver.version: unknown
at org.openqa.selenium.os.WindowsUtils.executeCommand(WindowsUtils.java:558)
at org.openqa.selenium.os.WindowsUtils.runRegQuery(WindowsUtils.java:627)
at org.openqa.selenium.os.WindowsUtils.readStringRegistryValue(WindowsUtils.java:447)
at org.openqa.selenium.os.WindowsUtils.getLocalAppDataPath(WindowsUtils.java:274)
at org.openqa.selenium.browserlaunchers.locators.GoogleChromeLocator.usualWindowsLauncherLoc
ations(GoogleChromeLocator.java:64)
at org.openqa.selenium.browserlaunchers.locators.GoogleChromeLocator.usualLauncherLocations(
GoogleChromeLocator.java:50)
at org.openqa.selenium.browserlaunchers.locators.SingleBrowserLocator.browserDefaultPath(Sin
gleBrowserLocator.java:93)
at org.openqa.selenium.browserlaunchers.locators.SingleBrowserLocator.findAtADefaultLocation
(SingleBrowserLocator.java:81)
at org.openqa.selenium.browserlaunchers.locators.SingleBrowserLocator.findBrowserLocation(Si
ngleBrowserLocator.java:50)
at org.openqa.selenium.browserlaunchers.locators.SingleBrowserLocator.findBrowserLocationOrF
ail(SingleBrowserLocator.java:38)
at org.openqa.selenium.server.browserlaunchers.BrowserInstallationCache.locateBrowserInstall
ation(BrowserInstallationCache.java:46)
at org.openqa.selenium.server.browserlaunchers.GoogleChromeLauncher.<init>(GoogleChromeLaunc
her.java:67)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.createBrowserLauncher(
BrowserLauncherFactory.java:164)
... 8 more
Caused by: java.lang.RuntimeException: exec return code 1:
ERROR: The system was unable to find the specified registry key or value.
at org.openqa.selenium.os.WindowsRegistryException.<init>(WindowsRegistryException.java:35)
... 25 more
看到HTML套件异常:
java.lang.RuntimeException:org.openqa.selenium.os.WindowsRegistryException:管理时出现问题
注册表,操作系统版本“6.1”,regVersion1=false
构建信息:版本:“2.33.0”,修订版:“6c40c18”,时间:“2013-04-09 17:22:56”
系统信息:os.name:'Windows 7',os.arch:'amd64',os.version:'6.1',java.version:'1.6.038'
驱动程序信息:驱动程序。版本:未知
位于org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.createBrowserLauncher(
BrowserLauncherFactory.java:175)
位于org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.getBrowserLauncher(Bro
wserLauncherFactory.java:109)
位于org.openqa.selenium.server.htmlrunner.htmlauncher.getBrowserLauncher(htmlauncher.java:7
9)
位于org.openqa.selenium.server.htmlrunner.htmluncher.runHTMLSuite(htmluncher.java:139)
位于org.openqa.selenium.server.htmlrunner.htmluncher.runHTMLSuite(htmluncher.java:198)
位于org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:630)
位于org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:305)
位于org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:245)
位于org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:54)
原因:org.openqa.selenium.os.WindowsRegistryException:管理注册表时出现问题,操作系统
版本“6.1”,regVersion1=false
构建信息:版本:“2.33.0”,修订版:“6c40c18”,时间:“2013-04-09 17:22:56”
系统信息:os.name:'Windows 7',os.arch:'amd64',os.version:'6.1',java.version:'1.6.038'
驱动程序信息:驱动程序。版本:未知
位于org.openqa.selenium.os.WindowsUtils.executeCommand(WindowsUtils.java:558)
位于org.openqa.selenium.os.WindowsUtils.runRegQuery(WindowsUtils.java:627)
位于org.openqa.selenium.os.WindowsUtils.readStringRegistryValue(WindowsUtils.java:447)
位于org.openqa.selenium.os.WindowsUtils.getLocalAppDataPath(WindowsUtils.java:274)
位于org.openqa.selenium.browserlaunchers.locators.GoogleChromeLocator.usualWindowsLauncherLoc
(GoogleChromeLocator.java:64)
位于org.openqa.selenium.browserlaunchers.locators.GoogleChromeLocator.usualluncherlocations(
GoogleChromeLocator.java:50)
位于org.openqa.selenium.browserlaunchers.locators.SingleBrowserLocator.browserDefaultPath(Sin
gleBrowserLocator.java:93)
位于org.openqa.selenium.browserlaunchers.locators.SingleBrowserLocator.findAtADefaultLocation
(SingleBrowserLocator.java:81)
位于org.openqa.selenium.browserlaunchers.locators.SingleBrowserLocator.findBrowserLocation(Si
ngleBrowserLocator.java:50)
位于org.openqa.selenium.browserlaunchers.locators.SingleBrowserLocator.findBrowserLocationOrF
ail(SingleBrowserLocator.java:38)
位于org.openqa.selenium.server.browserlaunchers.BrowserInstallationCache.locateBrowserInstall
初始化(BrowserInstallationCache.java:46)
在org.openqa.selenium.server.browserlaunchers.GoogleChromeLauncher
她的名字(java:67)
位于sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)
位于sun.reflect.NativeConstructorAccessorImpl.newInstance(未知源)
位于sun.reflect.delegatingConstructor或AccessorImpl.newInstance(未知源)
位于java.lang.reflect.Constructor.newInstance(未知源)
位于org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.createBrowserLauncher(
BrowserLauncherFactory.java:164)
... 8个以上
原因:java.lang.RuntimeException:exec返回代码1:
错误:系统找不到指定的注册表项或值。
位于org.openqa.selenium.os.WindowsRegistryException。(WindowsRegistryException.java:35)
... 25多
最终,我希望允许selenium作为服务运行,因此我需要Chrome在本地系统帐户下工作。据我所知,selenium独立jar文件应该已经包含一个google chrome驱动程序,所以我没有理由需要下载它
另外,在运行测试套件时,我遇到一个错误,告诉我需要将Google Chrome添加到path变量中。我这样做了,但是我得到了上面的错误,因此似乎selenium可以找到chrome.exe,它只是在获取一些不存在的注册表项或在找到chrome后无法启动chrome时遇到了问题。我为所有用户安装了chrome,所以Google chrome安装在程序文件(x86)中。同样,当从我的当前帐户(我用来安装chrome的帐户)运行并具有管理员权限时,chrome测试通过。在这个问题上有任何帮助都会很好 尝试比较chrome的版本,并尝试硬编码现有chrome的路径