{"action":"created","issue":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/419","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/419/labels{/name}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/419/comments","events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/419/events","html_url":"https://github.com/webdriverio/webdriverio/issues/419","id":56620787,"number":419,"title":"waitForExist returns (null, false) on a timeout","user":{"login":"notnarb","id":1731591,"avatar_url":"https://avatars.githubusercontent.com/u/1731591?v=3","gravatar_id":"","url":"https://api.github.com/users/notnarb","html_url":"https://github.com/notnarb","followers_url":"https://api.github.com/users/notnarb/followers","following_url":"https://api.github.com/users/notnarb/following{/other_user}","gists_url":"https://api.github.com/users/notnarb/gists{/gist_id}","starred_url":"https://api.github.com/users/notnarb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notnarb/subscriptions","organizations_url":"https://api.github.com/users/notnarb/orgs","repos_url":"https://api.github.com/users/notnarb/repos","events_url":"https://api.github.com/users/notnarb/events{/privacy}","received_events_url":"https://api.github.com/users/notnarb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webdriverio/webdriverio/labels/Enhancement","name":"Enhancement","color":"02d7e1"},{"url":"https://api.github.com/repos/webdriverio/webdriverio/labels/Project%20Related","name":"Project Related","color":"ffffff"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-05T02:56:20Z","updated_at":"2015-02-06T22:41:06Z","closed_at":null,"body":"It seems that most commands will return an error (breaking the chain) when an attempted element is not found, but it seems like waitForExist acts a little differently:\r\n```javascript\r\nif(now - start > ms) {\r\n    return cb(null, false);\r\n}\r\n```\r\nWhich allows the chain to continue unless a specific callback is in place to catch a 'false' result value.\r\n\r\ne.g.:\r\n```javascript\r\nclient()\r\n    .waitForExist('.loadingIcon')\r\n    .click('.loadingIcon')\r\n```\r\nwill continue (without failure) to the click event even if the waitForExist loop times out.\r\n\r\n---\r\nPerhaps a new error type should be defined and thrown in this instance?\r\nOr maybe the documentation could more clearly reflect that it is not supposed to error on a failure to find an element, and instead return false as a result"},"comment":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments/73326533","html_url":"https://github.com/webdriverio/webdriverio/issues/419#issuecomment-73326533","issue_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/419","id":73326533,"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-02-06T22:41:06Z","updated_at":"2015-02-06T22:41:06Z","body":"Sounds good, :+1: "}}