{"action":"created","comment":{"url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/comments/241793432","pull_request_review_id":185159098,"id":241793432,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTc5MzQzMg==","diff_hunk":"@@ -45,7 +58,19 @@ export const elementErrorHandler = (fn) => (commandName, commandFn) => {\n             }).apply(this)\n         }\n \n-        return fn(commandName, commandFn).apply(this, args)\n+        try {\n+            return fn(commandName, commandFn).apply(this, args)\n+        } catch(error) {\n+            if (error.message.includes(\"stale element reference\")) {\n+                refetchElement(this).then(element => {","path":"packages/webdriverio/src/middlewares.js","position":36,"original_position":36,"commit_id":"dca1385b29b692b0b21d4bd1f6552cb03f1ed4ca","original_commit_id":"dca1385b29b692b0b21d4bd1f6552cb03f1ed4ca","user":{"login":"christian-bromann","id":731337,"node_id":"MDQ6VXNlcjczMTMzNw==","avatar_url":"https://avatars2.githubusercontent.com/u/731337?v=4","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},"body":"same as above","created_at":"2018-12-14T15:33:44Z","updated_at":"2018-12-14T15:33:49Z","html_url":"https://github.com/webdriverio/webdriverio/pull/3118#discussion_r241793432","pull_request_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/3118","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/comments/241793432"},"html":{"href":"https://github.com/webdriverio/webdriverio/pull/3118#discussion_r241793432"},"pull_request":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/3118"}}},"pull_request":{"url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/3118","id":237396009,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3Mzk2MDA5","html_url":"https://github.com/webdriverio/webdriverio/pull/3118","diff_url":"https://github.com/webdriverio/webdriverio/pull/3118.diff","patch_url":"https://github.com/webdriverio/webdriverio/pull/3118.patch","issue_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/3118","number":3118,"state":"open","locked":false,"title":"wedbdriverio & webdriver: initial stale element handler work","user":{"login":"abjerstedt","id":4043890,"node_id":"MDQ6VXNlcjQwNDM4OTA=","avatar_url":"https://avatars1.githubusercontent.com/u/4043890?v=4","gravatar_id":"","url":"https://api.github.com/users/abjerstedt","html_url":"https://github.com/abjerstedt","followers_url":"https://api.github.com/users/abjerstedt/followers","following_url":"https://api.github.com/users/abjerstedt/following{/other_user}","gists_url":"https://api.github.com/users/abjerstedt/gists{/gist_id}","starred_url":"https://api.github.com/users/abjerstedt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abjerstedt/subscriptions","organizations_url":"https://api.github.com/users/abjerstedt/orgs","repos_url":"https://api.github.com/users/abjerstedt/repos","events_url":"https://api.github.com/users/abjerstedt/events{/privacy}","received_events_url":"https://api.github.com/users/abjerstedt/received_events","type":"User","site_admin":false},"body":"## Proposed changes\r\n\r\n[//]: # (Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.)\r\nI am adding a handler to refetch an element in the event of a stale element, and then retry the failed command.\r\n\r\nThis resolves https://github.com/webdriverio/webdriverio/issues/3097\r\n\r\n## Types of changes\r\n\r\n[//]: # (What types of changes does your code introduce to WebdriverIO?)\r\n[//]: # (_Put an `x` in the boxes that apply_)\r\n\r\n- [ ] Bugfix (non-breaking change which fixes an issue)\r\n- [X] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)\r\n\r\n## Checklist\r\n\r\n[//]: # (_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._)\r\n\r\n- [X] I have read the [CONTRIBUTING](https://github.com/webdriverio/webdriverio/blob/master/CONTRIBUTING.md) doc\r\n- [ ] I have added tests that prove my fix is effective or that my feature works\r\n- [ ] I have added necessary documentation (if appropriate)\r\n\r\n## Further comments\r\n\r\n[//]: # (If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...)\r\n\r\n### Reviewers: @webdriverio/technical-committee\r\n","created_at":"2018-12-10T17:03:49Z","updated_at":"2018-12-14T15:33:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cdf80ad4816722d12ca528cd141d1b330a22580f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":32907520,"node_id":"MDU6TGFiZWwzMjkwNzUyMA==","url":"https://api.github.com/repos/webdriverio/webdriverio/labels/Enhancement","name":"Enhancement","color":"02d7e1","default":false},{"id":1159686036,"node_id":"MDU6TGFiZWwxMTU5Njg2MDM2","url":"https://api.github.com/repos/webdriverio/webdriverio/labels/PR:%20Polish%20:nail_care:","name":"PR: Polish :nail_care:","color":"fbca04","default":false},{"id":1111890849,"node_id":"MDU6TGFiZWwxMTExODkwODQ5","url":"https://api.github.com/repos/webdriverio/webdriverio/labels/webdriver","name":"webdriver","color":"ededed","default":false},{"id":1034225700,"node_id":"MDU6TGFiZWwxMDM0MjI1NzAw","url":"https://api.github.com/repos/webdriverio/webdriverio/labels/webdriverio","name":"webdriverio","color":"ededed","default":false},{"id":1039775325,"node_id":"MDU6TGFiZWwxMDM5Nzc1MzI1","url":"https://api.github.com/repos/webdriverio/webdriverio/labels/work-in-progress","name":"work-in-progress","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/3118/commits","review_comments_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/3118/comments","review_comment_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/3118/comments","statuses_url":"https://api.github.com/repos/webdriverio/webdriverio/statuses/dca1385b29b692b0b21d4bd1f6552cb03f1ed4ca","head":{"label":"webdriverio:ab/refetchElementChain","ref":"ab/refetchElementChain","sha":"dca1385b29b692b0b21d4bd1f6552cb03f1ed4ca","user":{"login":"webdriverio","id":6512473,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1MTI0NzM=","avatar_url":"https://avatars1.githubusercontent.com/u/6512473?v=4","gravatar_id":"","url":"https://api.github.com/users/webdriverio","html_url":"https://github.com/webdriverio","followers_url":"https://api.github.com/users/webdriverio/followers","following_url":"https://api.github.com/users/webdriverio/following{/other_user}","gists_url":"https://api.github.com/users/webdriverio/gists{/gist_id}","starred_url":"https://api.github.com/users/webdriverio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webdriverio/subscriptions","organizations_url":"https://api.github.com/users/webdriverio/orgs","repos_url":"https://api.github.com/users/webdriverio/repos","events_url":"https://api.github.com/users/webdriverio/events{/privacy}","received_events_url":"https://api.github.com/users/webdriverio/received_events","type":"Organization","site_admin":false},"repo":{"id":2296970,"node_id":"MDEwOlJlcG9zaXRvcnkyMjk2OTcw","name":"webdriverio","full_name":"webdriverio/webdriverio","private":false,"owner":{"login":"webdriverio","id":6512473,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1MTI0NzM=","avatar_url":"https://avatars1.githubusercontent.com/u/6512473?v=4","gravatar_id":"","url":"https://api.github.com/users/webdriverio","html_url":"https://github.com/webdriverio","followers_url":"https://api.github.com/users/webdriverio/followers","following_url":"https://api.github.com/users/webdriverio/following{/other_user}","gists_url":"https://api.github.com/users/webdriverio/gists{/gist_id}","starred_url":"https://api.github.com/users/webdriverio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webdriverio/subscriptions","organizations_url":"https://api.github.com/users/webdriverio/orgs","repos_url":"https://api.github.com/users/webdriverio/repos","events_url":"https://api.github.com/users/webdriverio/events{/privacy}","received_events_url":"https://api.github.com/users/webdriverio/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/webdriverio/webdriverio","description":"Next-gen WebDriver test automation framework for Node.js","fork":false,"url":"https://api.github.com/repos/webdriverio/webdriverio","forks_url":"https://api.github.com/repos/webdriverio/webdriverio/forks","keys_url":"https://api.github.com/repos/webdriverio/webdriverio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webdriverio/webdriverio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webdriverio/webdriverio/teams","hooks_url":"https://api.github.com/repos/webdriverio/webdriverio/hooks","issue_events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/events{/number}","events_url":"https://api.github.com/repos/webdriverio/webdriverio/events","assignees_url":"https://api.github.com/repos/webdriverio/webdriverio/assignees{/user}","branches_url":"https://api.github.com/repos/webdriverio/webdriverio/branches{/branch}","tags_url":"https://api.github.com/repos/webdriverio/webdriverio/tags","blobs_url":"https://api.github.com/repos/webdriverio/webdriverio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webdriverio/webdriverio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webdriverio/webdriverio/git/refs{/sha}","trees_url":"https://api.github.com/repos/webdriverio/webdriverio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webdriverio/webdriverio/statuses/{sha}","languages_url":"https://api.github.com/repos/webdriverio/webdriverio/languages","stargazers_url":"https://api.github.com/repos/webdriverio/webdriverio/stargazers","contributors_url":"https://api.github.com/repos/webdriverio/webdriverio/contributors","subscribers_url":"https://api.github.com/repos/webdriverio/webdriverio/subscribers","subscription_url":"https://api.github.com/repos/webdriverio/webdriverio/subscription","commits_url":"https://api.github.com/repos/webdriverio/webdriverio/commits{/sha}","git_commits_url":"https://api.github.com/repos/webdriverio/webdriverio/git/commits{/sha}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/comments{/number}","issue_comment_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments{/number}","contents_url":"https://api.github.com/repos/webdriverio/webdriverio/contents/{+path}","compare_url":"https://api.github.com/repos/webdriverio/webdriverio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webdriverio/webdriverio/merges","archive_url":"https://api.github.com/repos/webdriverio/webdriverio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webdriverio/webdriverio/downloads","issues_url":"https://api.github.com/repos/webdriverio/webdriverio/issues{/number}","pulls_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls{/number}","milestones_url":"https://api.github.com/repos/webdriverio/webdriverio/milestones{/number}","notifications_url":"https://api.github.com/repos/webdriverio/webdriverio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/labels{/name}","releases_url":"https://api.github.com/repos/webdriverio/webdriverio/releases{/id}","deployments_url":"https://api.github.com/repos/webdriverio/webdriverio/deployments","created_at":"2011-08-30T19:02:35Z","updated_at":"2018-12-14T15:27:57Z","pushed_at":"2018-12-14T14:38:05Z","git_url":"git://github.com/webdriverio/webdriverio.git","ssh_url":"git@github.com:webdriverio/webdriverio.git","clone_url":"https://github.com/webdriverio/webdriverio.git","svn_url":"https://github.com/webdriverio/webdriverio","homepage":"http://webdriver.io","size":10031,"stargazers_count":4446,"watchers_count":4446,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1200,"mirror_url":null,"archived":false,"open_issues_count":60,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1200,"open_issues":60,"watchers":4446,"default_branch":"master"}},"base":{"label":"webdriverio:master","ref":"master","sha":"96e9c28faa7cf8749dd08c04e95c153b1b5c6971","user":{"login":"webdriverio","id":6512473,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1MTI0NzM=","avatar_url":"https://avatars1.githubusercontent.com/u/6512473?v=4","gravatar_id":"","url":"https://api.github.com/users/webdriverio","html_url":"https://github.com/webdriverio","followers_url":"https://api.github.com/users/webdriverio/followers","following_url":"https://api.github.com/users/webdriverio/following{/other_user}","gists_url":"https://api.github.com/users/webdriverio/gists{/gist_id}","starred_url":"https://api.github.com/users/webdriverio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webdriverio/subscriptions","organizations_url":"https://api.github.com/users/webdriverio/orgs","repos_url":"https://api.github.com/users/webdriverio/repos","events_url":"https://api.github.com/users/webdriverio/events{/privacy}","received_events_url":"https://api.github.com/users/webdriverio/received_events","type":"Organization","site_admin":false},"repo":{"id":2296970,"node_id":"MDEwOlJlcG9zaXRvcnkyMjk2OTcw","name":"webdriverio","full_name":"webdriverio/webdriverio","private":false,"owner":{"login":"webdriverio","id":6512473,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1MTI0NzM=","avatar_url":"https://avatars1.githubusercontent.com/u/6512473?v=4","gravatar_id":"","url":"https://api.github.com/users/webdriverio","html_url":"https://github.com/webdriverio","followers_url":"https://api.github.com/users/webdriverio/followers","following_url":"https://api.github.com/users/webdriverio/following{/other_user}","gists_url":"https://api.github.com/users/webdriverio/gists{/gist_id}","starred_url":"https://api.github.com/users/webdriverio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webdriverio/subscriptions","organizations_url":"https://api.github.com/users/webdriverio/orgs","repos_url":"https://api.github.com/users/webdriverio/repos","events_url":"https://api.github.com/users/webdriverio/events{/privacy}","received_events_url":"https://api.github.com/users/webdriverio/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/webdriverio/webdriverio","description":"Next-gen WebDriver test automation framework for Node.js","fork":false,"url":"https://api.github.com/repos/webdriverio/webdriverio","forks_url":"https://api.github.com/repos/webdriverio/webdriverio/forks","keys_url":"https://api.github.com/repos/webdriverio/webdriverio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webdriverio/webdriverio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webdriverio/webdriverio/teams","hooks_url":"https://api.github.com/repos/webdriverio/webdriverio/hooks","issue_events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/events{/number}","events_url":"https://api.github.com/repos/webdriverio/webdriverio/events","assignees_url":"https://api.github.com/repos/webdriverio/webdriverio/assignees{/user}","branches_url":"https://api.github.com/repos/webdriverio/webdriverio/branches{/branch}","tags_url":"https://api.github.com/repos/webdriverio/webdriverio/tags","blobs_url":"https://api.github.com/repos/webdriverio/webdriverio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webdriverio/webdriverio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webdriverio/webdriverio/git/refs{/sha}","trees_url":"https://api.github.com/repos/webdriverio/webdriverio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webdriverio/webdriverio/statuses/{sha}","languages_url":"https://api.github.com/repos/webdriverio/webdriverio/languages","stargazers_url":"https://api.github.com/repos/webdriverio/webdriverio/stargazers","contributors_url":"https://api.github.com/repos/webdriverio/webdriverio/contributors","subscribers_url":"https://api.github.com/repos/webdriverio/webdriverio/subscribers","subscription_url":"https://api.github.com/repos/webdriverio/webdriverio/subscription","commits_url":"https://api.github.com/repos/webdriverio/webdriverio/commits{/sha}","git_commits_url":"https://api.github.com/repos/webdriverio/webdriverio/git/commits{/sha}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/comments{/number}","issue_comment_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments{/number}","contents_url":"https://api.github.com/repos/webdriverio/webdriverio/contents/{+path}","compare_url":"https://api.github.com/repos/webdriverio/webdriverio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webdriverio/webdriverio/merges","archive_url":"https://api.github.com/repos/webdriverio/webdriverio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webdriverio/webdriverio/downloads","issues_url":"https://api.github.com/repos/webdriverio/webdriverio/issues{/number}","pulls_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls{/number}","milestones_url":"https://api.github.com/repos/webdriverio/webdriverio/milestones{/number}","notifications_url":"https://api.github.com/repos/webdriverio/webdriverio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/labels{/name}","releases_url":"https://api.github.com/repos/webdriverio/webdriverio/releases{/id}","deployments_url":"https://api.github.com/repos/webdriverio/webdriverio/deployments","created_at":"2011-08-30T19:02:35Z","updated_at":"2018-12-14T15:27:57Z","pushed_at":"2018-12-14T14:38:05Z","git_url":"git://github.com/webdriverio/webdriverio.git","ssh_url":"git@github.com:webdriverio/webdriverio.git","clone_url":"https://github.com/webdriverio/webdriverio.git","svn_url":"https://github.com/webdriverio/webdriverio","homepage":"http://webdriver.io","size":10031,"stargazers_count":4446,"watchers_count":4446,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1200,"mirror_url":null,"archived":false,"open_issues_count":60,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1200,"open_issues":60,"watchers":4446,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/3118"},"html":{"href":"https://github.com/webdriverio/webdriverio/pull/3118"},"issue":{"href":"https://api.github.com/repos/webdriverio/webdriverio/issues/3118"},"comments":{"href":"https://api.github.com/repos/webdriverio/webdriverio/issues/3118/comments"},"review_comments":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/3118/comments"},"review_comment":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/3118/commits"},"statuses":{"href":"https://api.github.com/repos/webdriverio/webdriverio/statuses/dca1385b29b692b0b21d4bd1f6552cb03f1ed4ca"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"christian-bromann"}}