{"action":"created","issue":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1219","repository_url":"https://api.github.com/repos/webdriverio/webdriverio","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1219/labels{/name}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1219/comments","events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1219/events","html_url":"https://github.com/webdriverio/webdriverio/issues/1219","id":145218304,"number":1219,"title":"Stale Element error is not beight caught","user":{"login":"qualityshepherd","id":3298906,"avatar_url":"https://avatars.githubusercontent.com/u/3298906?v=3","gravatar_id":"","url":"https://api.github.com/users/qualityshepherd","html_url":"https://github.com/qualityshepherd","followers_url":"https://api.github.com/users/qualityshepherd/followers","following_url":"https://api.github.com/users/qualityshepherd/following{/other_user}","gists_url":"https://api.github.com/users/qualityshepherd/gists{/gist_id}","starred_url":"https://api.github.com/users/qualityshepherd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qualityshepherd/subscriptions","organizations_url":"https://api.github.com/users/qualityshepherd/orgs","repos_url":"https://api.github.com/users/qualityshepherd/repos","events_url":"https://api.github.com/users/qualityshepherd/events{/privacy}","received_events_url":"https://api.github.com/users/qualityshepherd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webdriverio/webdriverio/labels/Bug","name":"Bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/webdriverio/webdriverio/milestones/2","html_url":"https://github.com/webdriverio/webdriverio/milestones/Upcoming","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/milestones/2/labels","id":1138980,"number":2,"title":"Upcoming","description":"Features or issues that are not blocked and reasonable to work on.","creator":{"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},"open_issues":18,"closed_issues":98,"state":"open","created_at":"2015-05-29T00:45:55Z","updated_at":"2016-04-24T23:52:17Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-04-01T16:01:15Z","updated_at":"2016-05-03T01:16:08Z","closed_at":null,"body":"## Stale Element error is not beight caught\r\n\r\nI'm getting a stale element when attempting to delete multiple items from a page (no refresh, items are just removed from the dom). After the first is deleted, it throws the error, kills the session, and hangs. WDIO should catch the error and retyr, but doesn't. \r\n\r\nI'm using page objects, if that matters. \r\n\r\n## Environment\r\n\r\n* WebdriverIO version: 4.0.5\r\n* Node.js version: 4.2.1\r\n* [Standalone mode or wdio testrunner](http://webdriver.io/guide/getstarted/modes.html): wdio\r\n* if wdio testrunner, running synchronous or asnychronous tests: sync\r\n* Additional wdio packages used (if applicable): jasmine\r\n\r\n## Log\r\n\r\n``` txt\r\n10:35:54.304 INFO - Executing: [get text: 7 [[ChromeDriver: chrome on MAC (0b722a4c0d36eed5aa856fc859151ea9)] -> css selector: span.details__title-text]])\r\n10:35:54.324 INFO - Done: [get text: 7 [[ChromeDriver: chrome on MAC (0b722a4c0d36eed5aa856fc859151ea9)] -> css selector: span.details__title-text]]\r\n10:35:54.336 INFO - Executing: [get text: 8 [[ChromeDriver: chrome on MAC (0b722a4c0d36eed5aa856fc859151ea9)] -> css selector: span.details__title-text]])\r\n10:35:54.358 INFO - Done: [get text: 8 [[ChromeDriver: chrome on MAC (0b722a4c0d36eed5aa856fc859151ea9)] -> css selector: span.details__title-text]]\r\n10:35:54.380 INFO - Executing: [get text: 9 [[ChromeDriver: chrome on MAC (0b722a4c0d36eed5aa856fc859151ea9)] -> css selector: span.details__title-text]])\r\n10:35:54.409 INFO - Done: [get text: 9 [[ChromeDriver: chrome on MAC (0b722a4c0d36eed5aa856fc859151ea9)] -> css selector: span.details__title-text]]\r\n10:35:54.417 INFO - Executing: [get text: 10 [[ChromeDriver: chrome on MAC (0b722a4c0d36eed5aa856fc859151ea9)] -> css selector: span.details__title-text]])\r\n10:35:54.450 INFO - Done: [get text: 10 [[ChromeDriver: chrome on MAC (0b722a4c0d36eed5aa856fc859151ea9)] -> css selector: span.details__title-text]]\r\n10:35:54.463 INFO - Executing: [get text: 11 [[ChromeDriver: chrome on MAC (0b722a4c0d36eed5aa856fc859151ea9)] -> css selector: span.details__title-text]])\r\n10:35:55.178 WARN - Exception thrown\r\norg.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document\r\n  (Session info: chrome=49.0.2623.110)\r\n  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.11.3 x86_64) (WARNING: The server did not provide any stacktrace information)\r\nCommand duration or timeout: 42 milliseconds\r\nFor documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html\r\nBuild info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'\r\nSystem info: host: '13.local', ip: '192.168.0.3', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.3', java.version: '1.7.0_75'\r\nSession ID: 0b722a4c0d36eed5aa856fc859151ea9\r\nDriver info: org.openqa.selenium.chrome.ChromeDriver\r\nCapabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/var/folders/39/2gckmzs959l7x2y1rn_cp9tc0000gn/T/.org.chromium.Chromium.5Wg63U, chromedriverVersion=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4)}, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=49.0.2623.110, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}]\r\n\tat sun.reflect.GeneratedConstructorAccessor23.newInstance(Unknown Source)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:526)\r\n\tat org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)\r\n\tat org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)\r\n\tat org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327)\r\n\tat org.openqa.selenium.remote.RemoteWebElement.getText(RemoteWebElement.java:179)\r\n\tat sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement$1.invoke(EventFiringWebDriver.java:335)\r\n\tat com.sun.proxy.$Proxy2.getText(Unknown Source)\r\n\tat org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.getText(EventFiringWebDriver.java:385)\r\n\tat sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.openqa.selenium.remote.server.KnownElements$1.invoke(KnownElements.java:64)\r\n\tat com.sun.proxy.$Proxy3.getText(Unknown Source)\r\n\tat org.openqa.selenium.remote.server.handler.GetElementText.call(GetElementText.java:30)\r\n\tat org.openqa.selenium.remote.server.handler.GetElementText.call(GetElementText.java:1)\r\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:262)\r\n\tat org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n10:35:55.179 WARN - Exception: stale element reference: element is not attached to the page document\r\n  (Session info: chrome=49.0.2623.110)\r\n  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.11.3 x86_64) (WARNING: The server did not provide any stacktrace information)\r\nCommand duration or timeout: 42 milliseconds\r\nFor documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html\r\nBuild info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'\r\nSystem info: host: '13.local', ip: '192.168.0.3', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.3', java.version: '1.7.0_75'\r\nSession ID: 0b722a4c0d36eed5aa856fc859151ea9\r\nDriver info: org.openqa.selenium.chrome.ChromeDriver\r\nCapabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/var/folders/39/2gckmzs959l7x2y1rn_cp9tc0000gn/T/.org.chromium.Chromium.5Wg63U, chromedriverVersion=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4)}, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=49.0.2623.110, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}]\r\n10:37:30.474 INFO - Executing: [delete session: 436d98a0-2f81-40b9-affe-baf181b0998c])\r\n10:37:30.552 INFO - Done: [delete session: 436d98a0-2f81-40b9-affe-baf181b0998c]\r\n```\r\n\r\n## Code Snippet\r\n\r\n```js\r\nthis.projectTitles.value.forEach(function(titleElm, index) {\r\n    titleText = browser.elementIdText(titleElm.ELEMENT).value;\r\n    if(titleText.match(projectNamePattern)) {\r\n        that.deleteProject(titleText);\r\n        //browser.pause(3333);\r\n    }\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments/216410234","html_url":"https://github.com/webdriverio/webdriverio/issues/1219#issuecomment-216410234","issue_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1219","id":216410234,"user":{"login":"albadam000","id":13465337,"avatar_url":"https://avatars.githubusercontent.com/u/13465337?v=3","gravatar_id":"","url":"https://api.github.com/users/albadam000","html_url":"https://github.com/albadam000","followers_url":"https://api.github.com/users/albadam000/followers","following_url":"https://api.github.com/users/albadam000/following{/other_user}","gists_url":"https://api.github.com/users/albadam000/gists{/gist_id}","starred_url":"https://api.github.com/users/albadam000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albadam000/subscriptions","organizations_url":"https://api.github.com/users/albadam000/orgs","repos_url":"https://api.github.com/users/albadam000/repos","events_url":"https://api.github.com/users/albadam000/events{/privacy}","received_events_url":"https://api.github.com/users/albadam000/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T01:16:08Z","updated_at":"2016-05-03T01:16:08Z","body":"We have the same problem, it started in version 2.46."}}