如何设置Firefox配置文件:硒RC,.NET客户端驱动程序? [英] How to set Firefox Profile: Selenium RC, .Net Client Driver?

查看:119
本文介绍了如何设置Firefox配置文件:硒RC,.NET客户端驱动程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Selenium RC + .NET客户端驱动程序。我创建了一个Firefox配置文件在我的C:\selenium\目录。这里是我的代码:

 昏暗MySelenium作为ISelenium =什么
MySelenium =新DefaultSelenium(本地主机,4444 *自定义C:/ Program Files文件/ Mozilla Firefox浏览器/ firefox.exe -profile C:/硒/,http://www.google.com/)

当我运行它,我得到以下错误:




无法启动新的浏览器会话:同时发动浏览器错误




什么是做到这一点。


的正确方法< DIV CLASS =h2_lin>解决方案

您需要通过RC,而不是在代码中启动它。



所以,你会做

  Java的罐子硒的server.jar -firefoxProfileTemplate C:\selenium\ 

启动浏览器,然后执行

 暗淡MySelenium作为ISelenium =什么
MySelenium =新DefaultSelenium(本地主机,4444,*火狐,http://www.google.com/)

和应该启动Firefox为你想要的配置文件。


I'm using Selenium RC + .Net Client Driver. I've created a Firefox profile in my c:\selenium\ directory. Here's my code:

Dim MySelenium As ISelenium = Nothing
MySelenium = New DefaultSelenium("localhost", 4444, "*custom C:/Program Files/Mozilla Firefox/firefox.exe  -profile c:/selenium/", "http://www.google.com/") 

When I run this, I get the following error:

Failed to start new browser session: Error while launching browser

What is the proper way to do this?

解决方案

You need to launch it via RC rather than in your code.

So you would do

java -jar selenium-server.jar -firefoxProfileTemplate c:\selenium\

to launch the browser and then do

Dim MySelenium As ISelenium = Nothing
MySelenium = New DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com/")

and that should launch Firefox for with the profile you want.

这篇关于如何设置Firefox配置文件:硒RC,.NET客户端驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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