Selenium jar包 与 Firefox3.6 兼容问题解决

Selenium RC 1.0.1 support for Firefox 3.6 February 1, 2010

UPDATE: On Feb 23, 2010 Selenium RC 1.0.3 was released. With this release it now supports

  • Firefox 3.6
  • Snow Leopard

If you are looking for instructions to download and setup the latest Selenium RC release, look here .


ORIGINAL ARTICLE:

A lot of people are having trouble with selenium and firefox 3.6. Here I have described the steps to first ensure that the problem you are seeing is due to the lack of selenium’s support for your browser version and then steps to patch the selenium-server.jar to make it work with Firefox 3.6.

Testing Selenium server support for Firefox

The quickest way to test if your selenium server is supporting the Firefox version installed on your machine is to start selenium server in an interactive mode. Let us walk through these steps.

  1. Run Selenium server in interactive mode. To do this run the command:
    java -jar selenium-server.jar -interactive -singleWindow
  2. Start new selenium browser session using the command:
    cmd=getNewBrowserSession&1=*firefox&2=http://www.google.com
  3. If you see a line saying Preparing Firefox profile... and no progress beyond that, there is a high likelihood that the Firefox browser version you have is not supported by your version of selenium server jar you have. If you have Firefox 3.6 and selenium 1.0.1, the next section shows how to fix the problem.
  4. If you don’t see a problem, run the following command:
    cmd=open&1=http://www.google.com

If the browser starts and you see Google’s home page in it, your basic setup seems to be fine.

Patching Selenium server to support Firefox 3.6

These steps should work for you on Unix, Mac or cygwin on windows. In case you are not using any of these, you would need to figure out the corresponding steps for our platform.

  1. Create a directory where you could manipulate the jar’s contents.
    cd ~/selenium101
  2. Copy your selenium-server.jar file in the newly created directory and cd into it.
    cp selenium-server.jar ~/selenium101/.
    cd ~/selenium101
  3. Unzip the jar files contents here and delete the jar file.
    unzip selenium-server.jar
    rm selenium-server.jar
  4. First find all the *.rdf files – you should see 5 of them:
    find . -name "*.rdf"
    ./customProfileDirCUSTFF/extensions/{538F0036-F358-4f84-A764-89FB437166B4}/install.rdf
    ./customProfileDirCUSTFF/extensions/readystate@openqa.org/install.rdf
    ./customProfileDirCUSTFFCHROME/extensions/{503A0CD4-EDC8-489b-853B-19E0BAA8F0A4}/install.rdf
    ./customProfileDirCUSTFFCHROME/extensions/{538F0036-F358-4f84-A764-89FB437166B4}/install.rdf
    ./customProfileDirCUSTFFCHROME/extensions/readystate@openqa.org/install.rdf
  5. In each of these files you will see
    <em:maxVersion>3.5.*</em:maxVersion>
    Change them to
    <em:maxVersion>3.6.*</em:maxVersion>
  6. all the files are now patched. To jar them back up run the following steps:
    zip -r selenium-server *
    mv selenium-server.zip selenium-server.jar

Rerun the browser tests as described earlier. Selenium should now be able to instantiate a new browser and drive it.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值