{"action":"created","issue":{"url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/687","labels_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/687/labels{/name}","comments_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/687/comments","events_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/687/events","html_url":"https://github.com/nightwatchjs/nightwatch/issues/687","id":111866383,"number":687,"title":"Stale element reference causes waitForElementVisible to fail even when the element is visible.","user":{"login":"rachna86","id":3902330,"avatar_url":"https://avatars.githubusercontent.com/u/3902330?v=3","gravatar_id":"","url":"https://api.github.com/users/rachna86","html_url":"https://github.com/rachna86","followers_url":"https://api.github.com/users/rachna86/followers","following_url":"https://api.github.com/users/rachna86/following{/other_user}","gists_url":"https://api.github.com/users/rachna86/gists{/gist_id}","starred_url":"https://api.github.com/users/rachna86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rachna86/subscriptions","organizations_url":"https://api.github.com/users/rachna86/orgs","repos_url":"https://api.github.com/users/rachna86/repos","events_url":"https://api.github.com/users/rachna86/events{/privacy}","received_events_url":"https://api.github.com/users/rachna86/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-16T16:34:34Z","updated_at":"2015-10-19T00:23:49Z","closed_at":null,"body":"Nightwatch version - 0.7.8\r\nBrowser - chrome 46.0\r\nOS version - OS X Yosemite\r\n\r\nI have the following code in my test - \r\n```\r\nbrowser.click('@element') \r\n.waitForElementVisible('@otherElement');\r\n```\r\n\r\nThe waitForElementVisible command fails even when the element is visible on the page. In order to get around this issue I have to add a pause. On looking at the logs from the --verbose command option I see the following error:\r\n```\r\nERROR Response 500 GET /wd/hub/session/da547091-91b7-4d4f-bd23-7bd70c5b48e6/element/9/displayed{ sessionId: 'da547091-91b7-4d4f-bd23-7bd70c5b48e6',\r\n  status: 10,\r\n  state: 'stale element reference',\r\n  value: \r\n   { message: 'stale element reference: element is not attached to the page document\\n  (Session info: chrome=46.0.2490.71)\\n  (Driver info: chromedriver=2.18.343837 (52eb4041461e46a6b73308ebb19e85787ced4281),platform=Mac OS X 10.10.5 x86_64) (WARNING: The server did not provide any stacktrace information)\\nCommand duration or timeout: 5 milliseconds\\nFor documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html\\nBuild info: version: \\'2.45.0\\', revision: \\'5017cb8\\', time: \\'2015-02-26 23:59:50\\'\\nSystem info: host: \\'N/A\\', ip: \\'N/A\\', os.name: \\'Mac OS X\\', os.arch: \\'x86_64\\', os.version: \\'10.10.5\\', java.version: \\'1.7.0_71\\'\\nSession ID: e1483d8203011114ffff6f1b128d5d2e\\nDriver info: org.openqa.selenium.chrome.ChromeDriver\\nCapabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/var/folders/f6/06dqw47j0bx4lwl4g__8hh300000gn/T/.org.chromium.Chromium.Gkb0Im}, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=46.0.2490.71, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}]',\r\n     suppressed: [],\r\n     localizedMessage: 'stale element reference: element is not attached to the page document\\n  (Session info: chrome=46.0.2490.71)\\n  (Driver info: chromedriver=2.18.343837 (52eb4041461e46a6b73308ebb19e85787ced4281),platform=Mac OS X 10.10.5 x86_64) (WARNING: The server did not provide any stacktrace information)\\nCommand duration or timeout: 5 milliseconds\\nFor documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html\\nBuild info: version: \\'2.45.0\\', revision: \\'5017cb8\\', time: \\'2015-02-26 23:59:50\\'\\nSystem info: host: \\'N/A\\', ip: \\'N/A\\', os.name: \\'Mac OS X\\', os.arch: \\'x86_64\\', os.version: \\'10.10.5\\', java.version: \\'1.7.0_71\\'\\nSession ID: e1483d8203011114ffff6f1b128d5d2e\\nDriver info: org.openqa.selenium.chrome.ChromeDriver\\nCapabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/var/folders/f6/06dqw47j0bx4lwl4g__8hh300000gn/T/.org.chromium.Chromium.Gkb0Im}, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=46.0.2490.71, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}]',\r\n     buildInformation: \r\n      { releaseLabel: '2.45.0',\r\n        buildTime: '2015-02-26 23:59:50',\r\n        class: 'org.openqa.selenium.internal.BuildInfo',\r\n        buildRevision: '5017cb8',\r\n        hCode: 592317409 },\r\n     cause: null,\r\n     systemInformation: 'System info: host: \\'N/A\\', ip: \\'N/A\\', os.name: \\'Mac OS X\\', os.arch: \\'x86_64\\', os.version: \\'10.10.5\\', java.version: \\'1.7.0_71\\'',\r\n     supportUrl: 'http://seleniumhq.org/exceptions/stale_element_reference.html',\r\n     class: 'org.openqa.selenium.StaleElementReferenceException',\r\n     additionalInformation: '\\nSession ID: e1483d8203011114ffff6f1b128d5d2e\\nDriver info: org.openqa.selenium.chrome.ChromeDriver\\nCapabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/var/folders/f6/06dqw47j0bx4lwl4g__8hh300000gn/T/.org.chromium.Chromium.Gkb0Im}, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=46.0.2490.71, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}]',\r\n     hCode: 1902705498 },\r\n  class: 'org.openqa.selenium.remote.Response',\r\n  hCode: 1491989218 }\r\nINFO Request: GET /wd/hub/session/da547091-91b7-4d4f-bd23-7bd70c5b48e6/element/9/displayed \r\n - data:   \r\n - headers:  {\"Accept\":\"application/json\"}\r\n```\r\nWaitForElementVisible command should retry to find the element on getting the stale element reference error.\r\n"},"comment":{"url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/comments/149067426","html_url":"https://github.com/nightwatchjs/nightwatch/issues/687#issuecomment-149067426","issue_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/687","id":149067426,"user":{"login":"rachna86","id":3902330,"avatar_url":"https://avatars.githubusercontent.com/u/3902330?v=3","gravatar_id":"","url":"https://api.github.com/users/rachna86","html_url":"https://github.com/rachna86","followers_url":"https://api.github.com/users/rachna86/followers","following_url":"https://api.github.com/users/rachna86/following{/other_user}","gists_url":"https://api.github.com/users/rachna86/gists{/gist_id}","starred_url":"https://api.github.com/users/rachna86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rachna86/subscriptions","organizations_url":"https://api.github.com/users/rachna86/orgs","repos_url":"https://api.github.com/users/rachna86/repos","events_url":"https://api.github.com/users/rachna86/events{/privacy}","received_events_url":"https://api.github.com/users/rachna86/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T00:23:48Z","updated_at":"2015-10-19T00:23:48Z","body":"Apparently this is issue is only for waitForElementVisible command. "}}