Skip to content
Permalink
Browse files
WebDriver: HTTP status code is not correct for some of the errors
https://bugs.webkit.org/show_bug.cgi?id=177354

Reviewed by Brian Burg.

I think this changed in the spec at some point. The thing is that no such alert, frame and window and stale
element reference errors should return 404 instead of 400.

https://w3c.github.io/webdriver/webdriver-spec.html#handling-errors

* CommandResult.cpp:
(WebDriver::CommandResult::httpStatusCode const):

Canonical link: https://commits.webkit.org/193986@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Oct 2, 2017
1 parent b53589f commit 8b7f0e147d6f821da40188c97ad5227da9df0d1f
Showing with 18 additions and 3 deletions.
  1. +15 −0 Source/WebDriver/ChangeLog
  2. +3 −3 Source/WebDriver/CommandResult.cpp
@@ -1,3 +1,18 @@
2017-10-02 Carlos Garcia Campos <cgarcia@igalia.com>

WebDriver: HTTP status code is not correct for some of the errors
https://bugs.webkit.org/show_bug.cgi?id=177354

Reviewed by Brian Burg.

I think this changed in the spec at some point. The thing is that no such alert, frame and window and stale
element reference errors should return 404 instead of 400.

https://w3c.github.io/webdriver/webdriver-spec.html#handling-errors

* CommandResult.cpp:
(WebDriver::CommandResult::httpStatusCode const):

2017-09-19 Carlos Garcia Campos <cgarcia@igalia.com>

WebDriver: Implement commands to get and set the window rect
@@ -136,13 +136,13 @@ unsigned CommandResult::httpStatusCode() const
case ErrorCode::InvalidArgument:
case ErrorCode::InvalidElementState:
case ErrorCode::InvalidSelector:
return 400;
case ErrorCode::NoSuchAlert:
case ErrorCode::NoSuchCookie:
case ErrorCode::NoSuchElement:
case ErrorCode::NoSuchFrame:
case ErrorCode::NoSuchWindow:
case ErrorCode::StaleElementReference:
return 400;
case ErrorCode::NoSuchCookie:
case ErrorCode::NoSuchElement:
case ErrorCode::InvalidSessionID:
case ErrorCode::UnknownCommand:
return 404;

0 comments on commit 8b7f0e1

Please sign in to comment.