marcoslin / angularAMD

Facilitate use of RequireJS in AngularJS
http://marcoslin.github.io/angularAMD
MIT License
734 stars 171 forks source link

Failed: stale element reference: element is not attached to the page document (Session info: chrome=54.0.2840.71) (Driver info: chromedriver=2.26.436362 (5476ec6bf7ccbada1734a0cdec7d570bb042aa30) #179

Closed yashbindal closed 7 years ago

yashbindal commented 7 years ago

I have tried almost everything. Tried making browser wait, sleep, isDisplayed without wait function. But just can't get this to be working consistently. I have tried different versions of Chrome as well. Nothing seems to be working. I'd really appreciate any help.

There are two pages in my application where my code fails. But it's very random, sometimes it fails, sometimes it doesn't. Attaching my Code.

Method 1: browser.driver.wait(function(){ return element(by.id("dobDate")).isDisplayed(); }); element(by.id("dobDate")).sendKeys('mm/dd/yyyy');

Method 2: element(by.id("dobDate")).isDisplayed().then(function(isVisible){ if(isVisible){ element(by.id("dobDate")).sendKeys('mm/dd/yyyy'); } });

marcoslin commented 7 years ago

Sorry, I am not sure how this relate to angularAMD. Perhaps it's better to post your question in Stackoverflow?

yashbindal commented 7 years ago

I'm sorry, I posted here by mistake, wanted to post it in Protractor. Never mind though. Thanks!