diff --git a/lib/commands.js b/lib/commands.js index 566db575..2dbe6dc7 100644 --- a/lib/commands.js +++ b/lib/commands.js @@ -1987,8 +1987,9 @@ commands.dismissAlert = function() { */ commands.active = function() { var cb = findCallback(arguments); + var method = this.w3c ? 'GET' : 'POST'; this._jsonWireCall({ - method: 'POST' + method: method , relPath: '/element/active' , cb: callbackWithData(cb, this) }); diff --git a/lib/webdriver.js b/lib/webdriver.js index 757b7d58..860e33b6 100644 --- a/lib/webdriver.js +++ b/lib/webdriver.js @@ -122,10 +122,12 @@ Webdriver.prototype._init = function() { try{ jsonData = JSON.parse(data); _this.sessionID = jsonData.value ? jsonData.value.sessionId : false; + _this.w3c = false; resData = jsonData.value; if(!_this.sessionID && jsonData.status === 0 ){ _this.sessionID = jsonData.sessionId; + _this.w3c = true; } } catch(ignore){} if(!_this.sessionID){