我正在尝试运行 Selenium 的 Firefox 网络驱动程序并收到以下错误。我可以看到response
没有sessionId
- 违规行是self.session_id = response['sessionId']
- 但我不知道为什么。我已经通过以下方式运行它并得到相同的错误:
- Cygwin,运行鼻子测试
- Cygwin 直接
- Windows,运行鼻子测试
- 直接视窗
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\dev\tools\cygwin\home\207013288\dev\projects\scorpion\test\unit\test_
approve_workflows.py", line 27, in test_login
'password', userid='207013288', test=True)
File "C:\dev\tools\cygwin\home\207013288\dev\projects\scorpion\src\workflows.p
y", line 20, in login
browser = webdriver.Firefox()
File "C:\dev\sdks\Python33\lib\site-packages\selenium-2.32.0-py3.3.egg\seleniu
m\webdriver\firefox\webdriver.py", line 62, in __init__
desired_capabilities=capabilities)
File "C:\dev\sdks\Python33\lib\site-packages\selenium-2.32.0-py3.3.egg\seleniu
m\webdriver\remote\webdriver.py", line 72, in __init__
self.start_session(desired_capabilities, browser_profile)
File "C:\dev\sdks\Python33\lib\site-packages\selenium-2.32.0-py3.3.egg\seleniu
m\webdriver\remote\webdriver.py", line 116, in start_session
self.session_id = response['sessionId']
nose.proxy.KeyError: 'sessionId'
-------------------- >> begin captured logging << --------------------
selenium.webdriver.remote.remote_connection: DEBUG: POST http://127.0.0.1:63801/
hub/session {"sessionId": null, "desiredCapabilities": {"version": "", "browserN
ame": "firefox", "platform": "ANY", "javascriptEnabled": true}}
--------------------- >> end captured logging << ---------------------
我以前没有使用过 Selenium,我不知道从这里去哪里。