Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何使用Selenium RC运行Google Chrome?_Asp.net_Nunit_Selenium - Fatal编程技术网

Asp.net 如何使用Selenium RC运行Google Chrome?

Asp.net 如何使用Selenium RC运行Google Chrome?,asp.net,nunit,selenium,Asp.net,Nunit,Selenium,我正在尝试使用Selenium RC+Nunit+asp.net测试我的站点 我可以在Firefox、Safari、opera、IE8中进行测试,但不能在google chrome中进行测试。我把这个放在浏览器上 selenium = new DefaultSelenium(Server, ServerPort, "*chrome", DomainURL); 这总是会加载Firefox,但不是很好的chrom

我正在尝试使用Selenium RC+Nunit+asp.net测试我的站点

我可以在Firefox、Safari、opera、IE8中进行测试,但不能在google chrome中进行测试。我把这个放在浏览器上

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

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

如果我没记错的话,
*chrome
”用于启动Firefox的一种特殊模式(在这种模式下,您的应用程序拥有更多的特权,安全限制更少);所以,是Firefox而不是Google Chrome发布的这一事实是正常的

如果你想启动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上,所以我不能自己尝试。。。我在文档中找不到任何支持我的东西。。。不过,如果运气好的话,这可能会帮助你

无论如何,玩得开心



作为旁注:谷歌Chrome实际上不是发明“Chrome”这个词的人;这意味着,就像或实际上是Firefox浏览器所代表的“
*chrome
”。

使用浏览器
*googlechrome
是可以的。

如果您已经将chrome.exe路径添加到路径变量中,您可以使用*googlechrome或者使用*自定义路径到chrome.exe

,直接给出*Google chrome代替*chrome,否则给出chrome.exe的路径

乙二醇/


是的,这很有效。我只是觉得他们把它缩短成了chrome之类的。ThanksI从未将Google Chrome与Selenium RC结合使用,但我记得在Google Chrome真正存在之前,我就已经看过“*Chrome”;所以,用它来启动它似乎很奇怪。不客气:-)玩得开心!非常感谢,很久以来一直在寻找解决方案。您的脚本试图打开的页面不存在。因此,您将收到404错误。当您在任何浏览器中运行测试用例时,都会收到相同的错误。
Selenium selenium = new DefaultSelenium("localhost",4444,"*googlechrome C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","http://www.google.com");