{ "error": "invalid session id", "message": "No active session with id 1234", "stacktrace": "" }
In case of success commands should respond with:
{ "status": "0", "value": *, }
Yet, bindings expect error messages to contain "value" key set to error data.
Here is sample form C# bindings:
private static void UnpackAndThrowOnError(Response errorResponse) { // Check the status code of the error, and only handle if not success. if (errorResponse.Status != WebDriverResult.Success) { Dictionary<string, object> errorAsDictionary = errorResponse.Value as Dictionary<string, object>;
Python bindings expect "status" and "value" to be set
So could anybody clarify this situation:
1. Is it that bindings and driver implementations are currently lagging behind spec.
or
2. is it that error data dictionary (including message, error and stacktrace) should be packed into {"status": "*", "value": *} response?
{
"status": "0","value": {"error": "invalid session id","message": "No active session with id 1234","stacktrace": ""}
}
The bindings are lagging the specification. The python bindings are the closest following currently, the SHA in your link is not the latest released version, but far from complete.
I am working to get them closer to the specification currently as and when I have time.
David
--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/0ad63cec-3d94-46d1-8f14-9475a6f77376%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-developers+unsub...@googlegroups.com.
So, what is best practice for WebDriver implementation at the moment?Should we implement error responses as in W3C spec, or as it is supported by bindings and other drivers at the moment/For example, here is a respnose from chromedriver:
{"name": "findElement","sessionId": "93ed195d-5b3e-428c-81cd-5ecf3fa751a9","status": 7,"value": {"message": "Unable to locate element: {\"method\":\"name\",\"selector\":\"zcasdasdasdasdasdq\"}","stackTrace": [{"columnNumber": 26,
"fileName": "file:///c:/users/nb5c6~1.aba/appdata/local/temp_~1/tmpwsbpyp/extensions/fxdriver@googlecode.com/components/driver-component.js",
"lineNumber": 10271,"methodName": "FirefoxDriver.prototype.findElementInternal_"},...]}}
or should we support both response formats by using new format, but keeping old keys (basically, mixing tow formats in one):
{"name": "findElement","sessionId": "93ed195d-5b3e-428c-81cd-5ecf3fa751a9","status": 7,"value": {"message": "Unable to locate element: {\"method\":\"name\",\"selector\":\"zcasdasdasdasdasdq\"}","stackTrace": [{"columnNumber": 26,
"fileName": "file:///c:/users/nb5c6~1.aba/appdata/local/temp_~1/tmpwsbpyp/extensions/fxdriver@googlecode.com/components/driver-component.js",
In case of success commands should respond with:
{ "status": "0", "value": *, }
1. Is it that bindings and driver implementations are currently lagging behind spec.