Skip to content

Commit

Permalink
Convert a bot exception to a webdriver exception in element.clear()
Browse files Browse the repository at this point in the history
Guess this has been around for ages, but without this fix
we'd return a status code of 13, not 12.
  • Loading branch information
shs96c committed Oct 12, 2016
1 parent 3716fc5 commit 04baa5d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions javascript/firefox-driver/js/wrappedElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,17 @@ WebElement.clearElement = function(respond, parameters) {
var element = Utils.getElementAt(parameters.id,
respond.session.getDocument());
bot.setWindow(respond.session.getWindow());
bot.action.clear(element);
respond.send();
try {
bot.action.clear(element);
respond.send();
} catch (e) {
var code = e.code;
if (code) {
respond.sendError(new WebDriverError(code, e.message));
} else {
throw e;
}
}
};
WebElement.clearElement.preconditions =
[fxdriver.preconditions.visible, fxdriver.preconditions.enabled, fxdriver.preconditions.writable];
Expand Down

0 comments on commit 04baa5d

Please sign in to comment.