如何使用Selenium RC的运行谷歌浏览器? [英] How to run Google Chrome with Selenium RC?

查看:523
本文介绍了如何使用Selenium RC的运行谷歌浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想测试我的网站与硒RC + NUnit的+ asp.net。

I am trying to test my site with Selenium RC + Nunit + asp.net.

我可以得到我的测试在Firefox,Safari浏览器,歌剧,IE 8的工作,但不是谷歌浏览器。我把这个在浏览器中arugment

I can get my tests to work in Firefox,Safari,opera,IE 8 but not google chrome. I put this in for the browser arugment

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

这虽然总是不加载了Firefox的良好铬。

This always loads up Firefox though and not good chrome.

推荐答案

如果我没有记错, *镀铬是用来发射的特殊模式火狐 (在您的应用程序有更多的privilegies模式 - 用更少的安全限制)的;因此,事实上,它的Firefox时启动,而不是谷歌Chrome,是正常的。

If I remember correctly, "*chrome" is used to launch a special mode of Firefox (a mode in which your application has more privilegies -- with less security restrictions) ; so, the fact that it's Firefox that is launched, and not Google Chrome, is normal.

如果要启动谷歌浏览器,你将不得不使用的东西比其他 *镀铬

If you want to launch Google Chrome, you will have to use something else than "*chrome".

结果
在交互模式下使用Selenium RC,像这样的东西:


Using Selenium RC in interactive mode, with something like this :

$ java -jar selenium-server.jar -interactive

和使用 getNewBrowserSession 命令无法正常:

cmd=getNewBrowserSession

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

I get the list of browsers is supports :

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 ,而不是 *镀铬

结果
我不是在Windows,所以我不能由我自己尝试......而在文档中我找不到任何支持我......不过,随着一点点运气,这可能会帮助你...


I'm not on Windows, so I can't try by myself... And I cannot find anything in the documentation to back me up... Still, with a bit of luck, this might help you...

不管怎样,有乐趣!

结果
一点题外话:谷歌浏览器是不是它发明了Chrome一词,其实之一;这意味着很多事情的,像的铬Mozilla的用户界面Chrome浏览器


As a sidenote : Google Chrome is not the one which invented the term "chrome", actually ; it means plenty of things, like Chrome Mozilla or User Interface Chrome

这篇关于如何使用Selenium RC的运行谷歌浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆