python - Why doesn't Selenium's response have a sessionId? -
i'm trying run selenium's firefox webdriver , getting error below. can see response
not have sessionid
- offending line self.session_id = response['sessionid']
- don't know why. i've run in following ways , same error:
- cygwin, running nosetests
- cygwin directly
- windows, running nosetests
- windows directly
---------------------------------------------------------------------- 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 << ---------------------
i haven't used selenium before , i'm not sure go here.
ok, first of i'd pulled out hair trying fix this. setup: python 2.7 firefox 22.0 selenium webdriver 2.33 windows xp (internet connection via proxy server)
spotted problem yet?
solution:
- open control panel
- internet options
- connections
- lan configuration
- on page see details of proxy server, complete checkbox: "do not use proxy server local addresses". checkbox selected (as makes sense not use proxy local addresses). unfortunately, selenium webdriver appears ignore checkbox , it's value. checked or unchecked, detect proxy server , apply url's (or @ least that's did in case.)
- click "advanced" button, , manually enter "127.0.0.1" in "exceptions" box.
- save change.
- re-run test in web driver, no longer see error message refers to: self.session_id = response['sessionid']
things didn't work me:
before finding solution (with aid of more experienced engineer) went through instructions here:http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp#advanceduserinteractions .. setting/changing/bypassing proxy. didn't me result looking for, though.
i looked @ this: implementing webdriverbackedselenium in python .. speaks of older version of webdriver, , suggests removing proxy settings system wide, absolute non-starter (as far i'm concerned).
Comments
Post a Comment