SeleniumHQ/selenium — pull request #223 by bayandin (2014-05-26 16:43:55+00:00)
Title: Do not pass sessionId if it is not exists

New Selenium 2.42.0 is not compatible with python's bindings (even with 2.42.0).

The reason is that to create new session python's tried to send a `null` for sessionId, and selenium server standalone will consider it as a error.

Example:
```bash
$ curl 'http://127.0.0.1:4444/wd/hub/session' -d '{"sessionId": null, "desiredCapabilities": {"platform": "ANY", "browserName": "firefox", "version": "", "javascriptEnabled": true}}'

{"status":13,"sessionId":null,"value":{"message":null,"localizedMessage":null,"suppressed":[],"cause":null,"class":"java.lang.NullPointerException","hCode":2043553261,"stackTrace":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]},"state":"unhandled error","class":"org.openqa.selenium.remote.Response","hCode":1942816664}
```

But without an sessionId identifier it works:
```
$ curl 'http://127.0.0.1:4444/wd/hub/session' -d '{"desiredCapabilities": {"platform": "ANY", "browserName": "firefox", "version": "", "javascriptEnabled": true}}'
```

It may be error in selenium server, but i try to fixed it for python bindings only.