【发布时间】:2017-10-29 09:20:49
【问题描述】:
我正在尝试使用 Firefox 53.03(64 位)和 Geckodriver 0.16 从 Python 2.7 执行 1 个测试脚本(从运行良好的 Selenium IDE 3.4 导出)。在我的本地计算机上 - Windows 7 Enterprise。
复制步骤:
- 从 Selenium IDE:将测试用例导出为“Python 2/unittest /WebDriver”。
- 保存为“按 Vol & Folio 搜索 - Unsuccessful.py”
- 推出 Python 2.7.12 Shell
- 文件/打开/“按 Vol & Folio 搜索 - Unsuccessful.py”
- 运行/运行模块
结果:
cmd 会话以 Geckodriver.exe + 空白 Firefox 页面打开
来自 Python 控制台的错误消息是:
Win32 上的 Python 2.7.12(v2.7.12:d33e0cf91556,2016 年 6 月 27 日,15:24:40)[MSC v.1500 64 位 (AMD64)] 键入“copyright”、“credits”或“license()”以获取更多信息。 重新启动:C:\Temp\Selenium\selenium-java-3.4.0\Search by Vol & Folio - Unsuccessful.py
================================================ ======================= 错误:test_search_by_vol_folio_unsuccessful_cancel (main.SearchByVolFolioUnsuccessfulCancel) -------------------------------------------------- -------------------- Traceback(最近一次调用最后一次):文件 “C:\Temp\Selenium\selenium-java-3.4.0\Search by Vol & Folio - Unsuccessful.py”,第 13 行,在 setUp 中 self.driver = webdriver.Firefox() 文件 "C:\Program Files\Common Files\Python\2.7\lib\site-packages\selenium\webdriver\firefox\webdriver.py", 第 155 行,在 init 中 keep_alive=True) 文件 "C:\Program Files\Common Files\Python\2.7\lib\site-packages\selenium\webdriver\remote\webdriver.py", 第 92 行,在 init 中 self.start_session(desired_capabilities, browser_profile) 文件“C:\Program Files\Common 文件\Python\2.7\lib\site-packages\selenium\webdriver\remote\webdriver.py", 第 183 行,在 start_session 中 self.capabilities = response['value'] KeyError: 'value'
----------------------------------- ----------------------- 在 5.250 秒内运行 1 次测试
失败(错误=1)
【问题讨论】:
-
您能考虑向我们展示您的作品吗?我认为您的问题与处理
webdrivers的selenium无关,但它与selenium-ide有关。请确认。谢谢
标签: python python-2.7 selenium