多测师是一家拥有先进的教学理念,强大的师资团队,业内好评甚多的接口自动化测试培训机构!

17727591462

联系电话

您现在所在位置:接口自动化测试培训 > 新闻资讯

如何让Selenium支持高版本的FireFox-自动化测试

更新时间:2022-05-09 09:24:58 作者:多测师 浏览:225

       今天写个自动刷新页面的脚本,发现在启动firefox的时候,出现一个类似如下的错误:

       请在文本框输入文字15:22:12.031 WARN - GET /selenium-server/driver/?cmd=getNewBrowserSession&1=*fir

efox&2=http://www.google.com HTTP/1.1

java.lang.RuntimeException: Firefox refused shutdown while preparing a profile

at org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLaunc

her.waitForFullProfileToBeCreated(FirefoxCustomProfileLauncher.java:277)

如何让Selenium支持高版本的FireFox-自动化测试

  后来查了google发现问题是selenium不支持高版本firefox, 解决方案如下:

  1、用winrar打开selenium-server.jar;

  2、查找两个目录:customProfileDirCUSTFFCHROME和customProfileDirCUSTFF;

  3、搜索每个目录,对每个文件install.rdf,编辑如下行:

  修改

<!-- Firefox -->

<em:targetApplication>

<Description>

<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>

<em:minVersion>1.4.1</em:minVersion>

<em:maxVersion>3.5.*</em:maxVersion>

</Description>

</em:targetApplication>

<!-- Firefox -->

<em:targetApplication>

<Description>

<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>

<em:minVersion>1.4.1</em:minVersion>

<em:maxVersion>3.6.*</em:maxVersion>

</Description>

</em:targetApplication>

       还可以改得更加大,那么就可以支持4.0 的firefox了。

       以上内容为大家介绍了自动化测试中的如何让Selenium支持高版本的FireFox,本文由多测师亲自撰写,希望对大家有所帮助。了解更多自动化测试相关知识:https://www.aichudan.com/xwzx/

联系电话

17727591462

返回顶部