如何在PHPUnit的Webdriver框架中使用自定义的Firefox配置文件? [英] How does one use a custom firefox profile with PHPUnit's Webdriver framework?

查看:125
本文介绍了如何在PHPUnit的Webdriver框架中使用自定义的Firefox配置文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道硒与RC,我曾经通过命令行操作符... -firefoxProfileTemplate,这将工作。现在使用Selenium2(Webdriver),这似乎不工作了。

由于我使用PHPUnit进行其他测试,我想继续使用它。任何人都知道如何定义一个自定义的Firefox的配置文件?

解决方案

这并没有明确地回答上面的问题,但是,它帮助解决眼前的问题,因为我的硒设置只会使用1个Firefox实例,而不是尝试加载它们。



这样说,这将有助于大部分用户在那里,因此我把它作为一个答案的原因在这里,而不是选择它作为正确的。

我在这里找到答案在 github上的phpunit-selenium问题队列。谢谢emaks。



使用命令行选项加载您的selenium服务器
$ b

-Dwebdriver.firefox .profile = PROFILE_NAME



注意: PROFILE_NAME是Firefox应用程序中profiles.ini的机器名称数据目录。这不是一个路径或不是。

I know with selenium RC, I used to pass a commandline operator... -firefoxProfileTemplate and that would work. Now working with Selenium2 (Webdriver), that doesn't seem to work anymore.

Since I'm using PHPUnit for other tests, I would like to continue to use it. Anyone know how to define a custom firefox profile for it?

解决方案

This does not explicitly answer the question above, however, it did help solve the immediate problem as my setup for selenium would only ever use 1 Firefox instance and not try to load them on the fly.

With that said, this would help the majority of users out there, thus the reason I'm putting it as an "Answer" here, but not selecting it as the correct one.

I found the answer here at phpunit-selenium issue queue on github. Thanks emaks.

Simply load your selenium server with the command line option

-Dwebdriver.firefox.profile=PROFILE_NAME

Note: PROFILE_NAME is the machine name located in your profiles.ini in the Firefox Application Data directory. It is not a path or what not.

这篇关于如何在PHPUnit的Webdriver框架中使用自定义的Firefox配置文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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