web自动化测试(一)Selenium3使用系列问题集
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了web自动化测试(一)Selenium3使用系列问题集,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1984字,纯文字阅读大概需要3分钟。
内容图文
![web自动化测试(一)Selenium3使用系列问题集](/upload/InfoBanner/zyjiaocheng/429/66f7a88d48a5441a8c9a713656e7c89b.jpg)
Selenium是一个用于Web应用程序测试的工具。Selenium测试直接运行在浏览器中,就像真正的用户在操作一样。本文主要讲述的是web测试中Selenium 3使用的问题集以及解决方案。
1. 无法启动FireFox--geckodriver
运行 driver=webdriver.Firefox()
运行报错:
Exception AttributeError: "'Service' object has no attribute 'process'" in <boun
d method Service.__del__ of <selenium.webdriver.firefox.service.Service object a
t 0x028940B0>> ignored
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executabl needs to be in PATH.
解决方案:
下载https://github.com/mozilla/geckodriver/releases 最新版,把geckodriver.exe加到系统path路径下,即可解决此问题。
2. Firefox默认安装,但找不到启动路径
selenium.common.exceptions.WebDriverException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line
解决方案:
加入这几行代码就可以解决。
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary # Create a new instance of the Firefox driver binary = FirefoxBinary(r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe') driver = webdriver.Firefox(firefox_binary=binary)
3. 无法启动IE 的问题
driver = webdriver.Ie()
selenium.common.exceptions.WebDriverException: Message: 'IEDriverServer.exe' executable needs to be in PATH. Please download from http://selenium-release.storage.googleapis.com/index.html and read up at https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.ie.service.Service object at 0x0276B6F0>> ignored
解决方案:
这里下载驱动: http://selenium-release.storage.googleapis.com/index.html?path=3.0/,把IEDriverServer.exe放到系统path目录即可。
【推荐课程:Python视频课程】
以上就是web自动化测试(一)Selenium 3使用系列问题集的详细内容,更多请关注Gxl网其它相关文章!
内容总结
以上是互联网集市为您收集整理的web自动化测试(一)Selenium3使用系列问题集全部内容,希望文章能够帮你解决web自动化测试(一)Selenium3使用系列问题集所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。