{"action":"closed","issue":{"url":"https://api.github.com/repos/codeborne/selenide/issues/277","labels_url":"https://api.github.com/repos/codeborne/selenide/issues/277/labels{/name}","comments_url":"https://api.github.com/repos/codeborne/selenide/issues/277/comments","events_url":"https://api.github.com/repos/codeborne/selenide/issues/277/events","html_url":"https://github.com/codeborne/selenide/issues/277","id":130016541,"number":277,"title":"Case to reproducing StaleElementReferenceException","user":{"login":"admizh","id":6014483,"avatar_url":"https://avatars.githubusercontent.com/u/6014483?v=3","gravatar_id":"","url":"https://api.github.com/users/admizh","html_url":"https://github.com/admizh","followers_url":"https://api.github.com/users/admizh/followers","following_url":"https://api.github.com/users/admizh/following{/other_user}","gists_url":"https://api.github.com/users/admizh/gists{/gist_id}","starred_url":"https://api.github.com/users/admizh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/admizh/subscriptions","organizations_url":"https://api.github.com/users/admizh/orgs","repos_url":"https://api.github.com/users/admizh/repos","events_url":"https://api.github.com/users/admizh/events{/privacy}","received_events_url":"https://api.github.com/users/admizh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-30T17:35:24Z","updated_at":"2016-01-31T20:40:01Z","closed_at":"2016-01-31T20:40:01Z","body":"This test is demonstrate 100% reproduce throwing StaleElementReferenceException. How do we solve it?\r\nBrowser chrome: v 48.0.2564.97 m\r\nChrome driver 2.20\r\n\r\n```java\r\n@Test()\r\n    public void refException() {\r\n        open(\"http://ya.ru\");\r\n        List<SelenideElement> elements = new ArrayList<>();\r\n        for (SelenideElement selenideElement : $$(\"#text\")) {\r\n            elements.add(selenideElement);\r\n        }\r\n        executeJavaScript(\"window.location.reload();\");\r\n        elements.get(0).sendKeys(\"Val\");\r\n    }\r\n```\r\n\r\n```exeption\r\njava.lang.reflect.UndeclaredThrowableException\r\n\tat com.sun.proxy.$Proxy15.sendKeys(Unknown Source)\r\n\tat onboarding.demo.Demo4WorkWithCollection.refException(Demo4WorkWithCollection.java:55)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)\r\n\tat org.testng.internal.Invoker.invokeMethod(Invoker.java:643)\r\n\tat org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)\r\n\tat org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)\r\n\tat org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)\r\n\tat org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)\r\n\tat org.testng.TestRunner.privateRun(TestRunner.java:782)\r\n\tat org.testng.TestRunner.run(TestRunner.java:632)\r\n\tat org.testng.SuiteRunner.runTest(SuiteRunner.java:366)\r\n\tat org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)\r\n\tat org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)\r\n\tat org.testng.SuiteRunner.run(SuiteRunner.java:268)\r\n\tat org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)\r\n\tat org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)\r\n\tat org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)\r\n\tat org.testng.TestNG.runSuitesLocally(TestNG.java:1169)\r\n\tat org.testng.TestNG.run(TestNG.java:1064)\r\n\tat org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)\r\n\tat org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:122)\r\nCaused by: java.lang.reflect.InvocationTargetException\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat com.codeborne.selenide.impl.SelenideElementProxy.dispatchAndRetry(SelenideElementProxy.java:82)\r\n\tat com.codeborne.selenide.impl.SelenideElementProxy.invoke(SelenideElementProxy.java:56)\r\n\t... 25 more\r\nCaused by: org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document\r\n  (Session info: chrome=48.0.2564.82)\r\n  (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.3 x86_64) (WARNING: The server did not provide any stacktrace information)\r\nCommand duration or timeout: 34 milliseconds\r\nFor documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html\r\nBuild info: version: '2.49.1', revision: '808c23b0963853d375cbe54b90bbd052e2528a54', time: '2016-01-21 09:37:52'\r\nSystem info: host: 'IJKN60267191A', ip: '192.168.1.230', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_72'\r\nDriver info: framework.driver.WebDriverController$LoggableChromeDriver\r\nCapabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={userDataDir=C:\\Users\\I301235\\AppData\\Local\\Temp\\scoped_dir7300_21717}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=48.0.2564.82, platform=WIN8_1, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]\r\nSession ID: 96f0e5a8d6601daecc57ed7f4d16fba0\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:423)\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```"}}