如何使用Selenium RC运行Google Chrome?

我想用Selenium RC + Nunit + asp.net来testing我的网站。

我可以让我的testing工作在Firefox,Safari,Opera,IE 8,但不是谷歌浏览器。 我把这个放在浏览器的地址栏里

selenium = new DefaultSelenium(Server, ServerPort, "*chrome", DomainURL); 

这总是加载Firefox,但不是很好的铬。

如果我没有记错的话, 可以使用“ *chrome ”来启动Firefox的一种特殊模式 (在这种模式下,应用程序拥有更多的特权 – 安全性更低) 。 所以,启动Firefox的事实,而不是谷歌浏览器是正常的。

如果您要启动Google Chrome,则必须使用“ *chrome ”以外的其他内容。

在交互模式下使用Selenium RC,像这样:

 $ java -jar selenium-server.jar -interactive 

并使用getNewBrowserSession命令不正确:

 cmd=getNewBrowserSession 

我得到的浏览器列表是支持的:

 23:43:09.317 INFO - Got result: Failed to start new browser session: Browser not supported: (Did you forget to add a *?) Supported browsers include: *firefox *mock *firefoxproxy *pifirefox *chrome *iexploreproxy *iexplore *firefox3 *safariproxy *googlechrome *konqueror *firefox2 *safari *piiexplore *firefoxchrome *opera *iehta *custom on session null 

所以,我猜你应该可以使用“ *googlechrome而不是“ *chrome来启动Google Chrome

我不在Windows上,所以我不能自己尝试…而且我找不到任何文件来支持我…然而,运气有点好,这可能会帮助你…

无论如何,玩得开心!

作为一个注释:Google Chrome实际上不是发明“铬”这个术语的那个, 这意味着很多东西 ,比如Chrome Mozilla或者用户界面Chrome

使用浏览器*googlechrome是好的。

其实就是以Firefox浏览器为代表的“ *chrome ”。

您可以使用* googlechrome,否则使用*自定义path_to_Chrome.exe文件

如果已将chrome.exepath添加到pathvariables中,请直接在* googlechrome中replace* chrome,否则请指定ch​​rome.exe的path。

例如/

 Selenium selenium = new DefaultSelenium("localhost",4444,"*googlechrome C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","http://www.google.com");