`

关于Selenium脚本在Win7 IE8环境下不能运行的问题及解决方案

阅读更多
运行环境:
64位 Win7 professional IE8, 浏览器默认设置
Selenium脚本中通过 setUp(url, "iexplore")的方式设置浏览器
以java -jar selenium-server.jar不带参数的方式启动selenium server,程序在多窗口的模式下运行.

启动任意一个selenium的测试,出现如下



然后脚本就停住,不能继续运行,试过好多台win7的机器,都是这个情况,但是在Win Xp的IE8下面运行良好。

解决方案如下,这个是我给客户发的Email,文中提到的URL可能不能访问:


There are two main reasons that we need to install other Browser to run the Selenium tests.
1. The most important reason is the Selenium can’t run the tests in Win7 IE8 when the IE is set to “Protected Mode”, currently, the IE setting in build server is in this mode.
So, I can’t start to run the selenium tests in build server now.
You can refer to this URL:
• http://stackoverflow.com/questions/1517623/internet-explorer-8-64bit-and-selenium-not-working
2. The selenium execution will be very slow when running in IE, if I run all the tests by Google chrome, it will take less than 3 hours, but more than 5 hours in IE 8 even after I optimized the scripts
You can refer to:
• http://old.nabble.com/Selenium-slow-in-IE-compared-to-firefox.-td12087754.html
• http://groups.google.com/group/selenium-developers/browse_thread/thread/160a92fcacb12a62
3. For functional testing, the selenium test results of execution would be same if we run it in different browsers

So, if we want to run the selenium tests in Builder server, there are two workarounds
1. First one is to set the IE to “Protected off mode” by setting: Internet Options->Security->" Internet " icon->Enable Protected Mode
        uncheck this option for all login user to let selenium tests run in "Protected Off" mode.
2. Install the Google Chrome or Firefox 3.0 to run the tests, Firefox3.6 is not supported directly.

总结:只要设置正确,IE下依然还是能运行的,唯一的区别就是运行速度,目前看来用Google Chrome去跑自动化测试最高效
PS:万一有语法错误,不要见笑,谢谢~
  • 大小: 31.1 KB
分享到:
评论

相关推荐

    Selenium遇到问题总结

    Selenium 遇到问题总结 Selenium 是一个自动化测试工具,广泛应用于 Web 应用程序测试中。但是,在使用 Selenium 进行测试时,常常会遇到一些问题。...同时,需要解决在 Win7 IE8 下运行 Selenium 时可能出现的问题。

    selenium-IEDriverServer_Win32_3.2.0

    **Selenium IEDriverServer** 是一个用于自动化Microsoft Internet Explorer浏览器的工具,它是Selenium WebDriver接口的一...了解其工作原理、配置和使用方法对于在Windows环境下进行Web应用的自动化测试至关重要。

    Selenium+Eclipse+Junit+TestNG自动化学习笔记

    #### 四、常见问题与解决方法 **1. 浏览器兼容性问题** - **使用不同的WebDriver和浏览器组合进行测试**。 **2. 元素定位困难** - **尝试使用不同的定位策略**(如ID、name、class、CSS selector、XPath)。 - *...

    chromedriver-win64_125.0.6420.3.zip

    8. **错误处理**:在使用Chromedriver时,可能会遇到权限问题、版本不兼容、找不到元素等错误,需要熟悉错误代码和解决策略,以确保测试流程的顺畅。 总结来说,`chromedriver-win64_125.0.6420.3.zip` 文件是自动...

    chromedriver-win64_126.0.6443.0.zip

    8. **错误处理**:在自动化测试过程中,可能会遇到各种错误,如找不到元素、网络问题等。Chromedriver提供了丰富的错误信息,帮助开发者诊断和解决问题。 9. **持续更新**:随着Chrome浏览器的频繁更新,...

Global site tag (gtag.js) - Google Analytics