Why doesn't Selenium's response have a sessionId? Why doesn't Selenium's response have a sessionId? selenium selenium

Why doesn't Selenium's response have a sessionId?


OK, first of all I'd like to say that I nearly pulled out all my hair trying to fix this.My setup:Python 2.7Firefox 22.0Selenium WebDriver 2.33Windows XP (internet connection via proxy server)

Spotted my problem yet?

Solution:

  • Open the control Panel
  • Internet options
  • Connections
  • LAN Configuration
  • On this page you will probably see the details of your proxy server, complete with a checkbox: "Do not use proxy server for local addresses". This checkbox is probably already selected (as it makes good sense to not use a proxy for local addresses). Unfortunately, Selenium WebDriver appears to ignore this checkbox and it's value. Checked or unchecked, it will detect your proxy server and apply it to all url's (or at least that's what it did in my case.)
  • Click the "Advanced" button, and manually enter "127.0.0.1" in the "Exceptions" box.
  • Save the change.
  • Re-run your test in web driver, hopefully you will no longer see error message that refers to: self.session_id = response['sessionId']

Things that didn't work for me:

Before finding this solution (with the aid of a more experienced engineer) I went through the instructions here:http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp#advanceduserinteractions.. for setting/changing/bypassing the proxy. Didn't get me the result I was looking for, though.

I also looked at this: Implementing WebdriverBackedSelenium in Python.. but it speaks of a older version of webdriver, and it suggests removing all the proxy settings system wide, which is an absolute non-starter (as far as I'm concerned).


MAC OSX SOLUTION

I'm using Python 2.7 and FireFox 48.0.2 and Chrome Versie 57.0.2987.98 (64-bit).

The error *self.session_id = response['sessionId']* for me was solved by going to System preferences -> Network -> Advanced in the Wifi Tab. -> Proxy's -> Turning "Automatic Proxydetection" on.

After changing this, the error no longer occurred.