{"action":"created","issue":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/493","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/493/labels{/name}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/493/comments","events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/493/events","html_url":"https://github.com/webdriverio/webdriverio/issues/493","id":66847390,"number":493,"title":"Random error about 1 in 5 tests","user":{"login":"grofit","id":927201,"avatar_url":"https://avatars.githubusercontent.com/u/927201?v=3","gravatar_id":"","url":"https://api.github.com/users/grofit","html_url":"https://github.com/grofit","followers_url":"https://api.github.com/users/grofit/followers","following_url":"https://api.github.com/users/grofit/following{/other_user}","gists_url":"https://api.github.com/users/grofit/gists{/gist_id}","starred_url":"https://api.github.com/users/grofit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grofit/subscriptions","organizations_url":"https://api.github.com/users/grofit/orgs","repos_url":"https://api.github.com/users/grofit/repos","events_url":"https://api.github.com/users/grofit/events{/privacy}","received_events_url":"https://api.github.com/users/grofit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-07T10:22:35Z","updated_at":"2015-04-18T16:52:03Z","closed_at":null,"body":"For some reason I get a weird error which stops execution about once in every 5 tests I run, where the error:\r\n\r\n```\r\nC:\\Code\\Web\\<some-project>\\node_modules\\webdriverio\\lib\\utils\\PromiseHandler.js:154\r\n                throw error;\r\n                      ^\r\nRuntimeError: RuntimeError\r\n     (UnknownError:13) An unknown server-side error occurred while processing the command.\r\n     Problem: POST /session//url\r\nBuild info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'\r\nSystem info: host: 'somePcName', ip: '192.168.1.79', os.name: 'Windows 8.1', os.arch: 'x86', os.version: '6.3', java.version: '1.8.0_40'\r\nDriver info: driver.version: unknown\u001B[1;30m\r\n\r\n     Callstack:\r\n     -> url(\"http://localhost:3000/\")\r\n```\r\n\r\nI am running windows 8.1 pro and testing with firefox currently in Cucumber JS, my init and shutdown looks like:\r\n\r\n```\r\nvar setupBrowser = function() {\r\n    var browser = webdriverio.remote({\r\n        desiredCapabilities: {\r\n            \"browserName\": 'firefox',\r\n            \"acceptSslCerts\": true,\r\n            \"security.fileuri.strict_origin_policy\": false\r\n        }\r\n    });\r\n    browser.init();\r\n    return browser;\r\n};\r\n\r\nthis.Before(function (callback) {\r\n        var self = this;\r\n        // setup some other stuff\r\n        this.testData = {};\r\n\r\n        this.browser = setupBrowser();\r\n        this.browser.rootUrl = this.clientRoot;\r\n\r\n        this.clearAllData(function () {\r\n            callback();\r\n        });\r\n    });\r\n\r\nthis.After(function(callback){\r\n        this.browser.end();\r\n        callback();\r\n    });\r\n```\r\n\r\nThe actual logic being run is:\r\n\r\n```\r\nthis.When(/^I visit (.*)$/, function(url, callback) {\r\n        var completeUrl = \"{1}{2}\".assign(this.clientRoot, url);\r\n\r\n        this.browser\r\n            .url(completeUrl)\r\n            .waitForPageLoad() // Custom command which polls JS for loaded flag but it doesnt get this far\r\n            .then(callback)\r\n            .catch(callback.fail);\r\n    });\r\n```\r\n\r\nThe selenium standalone output has no errors and just shows:\r\n\r\n```\r\n11:03:38.390 INFO - Done: [new session: Capabilities [{rotatable=true, acceptSslCerts=true, security.fileuri.strict_origin_policy=false, locationContextEnabled=true, browserName=firefox, ja\r\nvascriptEnabled=true, handlesAlerts=true, version=, platform=ANY, requestOrigins={name=webdriverio, version=2.4.5, url=http://webdriver.io}}]]\r\n```\r\n\r\nThen has nothing after it... I apologise for not having more information, but if you want me to do anything specific to yield better info I am more than happy to."},"comment":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments/94180320","html_url":"https://github.com/webdriverio/webdriverio/issues/493#issuecomment-94180320","issue_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/493","id":94180320,"user":{"login":"christian-bromann","id":731337,"avatar_url":"https://avatars.githubusercontent.com/u/731337?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-bromann","html_url":"https://github.com/christian-bromann","followers_url":"https://api.github.com/users/christian-bromann/followers","following_url":"https://api.github.com/users/christian-bromann/following{/other_user}","gists_url":"https://api.github.com/users/christian-bromann/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-bromann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-bromann/subscriptions","organizations_url":"https://api.github.com/users/christian-bromann/orgs","repos_url":"https://api.github.com/users/christian-bromann/repos","events_url":"https://api.github.com/users/christian-bromann/events{/privacy}","received_events_url":"https://api.github.com/users/christian-bromann/received_events","type":"User","site_admin":false},"created_at":"2015-04-18T16:52:03Z","updated_at":"2015-04-18T16:52:03Z","body":"According to the error message you loose your session id somewhere. That happens when you call end and continue using your webdriverio instance to execute commands. Make sure you don't reuse the webdriverio instance once you called `end`.\r\n\r\nIs this problem still valid?"}}