Skip to content

Commit 9b54a07

Browse files
committed
Marionette: Fixing error handling to conform to the standard
1 parent 2ac6a7d commit 9b54a07

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

java/client/src/org/openqa/selenium/remote/JsonToBeanConverter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ private <T> T convert(Class<T> clazz, Object source, int depth) {
112112
? (JsonObject) source
113113
: new JsonParser().parse((String) source).getAsJsonObject();
114114

115+
if (json.has("error") && ! json.get("error").isJsonNull()) {
116+
String state = json.get("error").getAsString();
117+
response.setState(state);
118+
response.setStatus(ErrorCodes.toStatus(state));
119+
response.setValue(convert(Object.class, json.get("message")));
120+
}
115121
if (json.has("state") && ! json.get("state").isJsonNull()) {
116122
String state = json.get("state").getAsString();
117123
response.setState(state);

java/client/test/org/openqa/selenium/TypingTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ public void testShouldNotTypeIntoElementsThatPreventKeyDownEvents() {
632632
}
633633

634634
@JavascriptEnabled
635-
@Ignore(value = {PHANTOMJS})
635+
@Ignore(value = {PHANTOMJS, MARIONETTE})
636636
@NotYetImplemented(HTMLUNIT)
637637
@Test
638638
public void testGenerateKeyPressEventEvenWhenElementPreventsDefault() {

0 commit comments

Comments
 (0)