Wednesday, 10 June 2015

angular protractor error: StaleElementReferenceError: stale element reference: element is not attached to the page document


You may see this issue sometime when you use protractor to test your angular application:

StaleElementReferenceError: stale element reference: element is not attached to the page document



Actually, this is wrong error, the real error is:


If your button is listed by ng-repeat, you should have numbers of buttons on your screen, so just use the first one by:


            var image_show_detail = element.all(by.name('image_show_detail')).first();
            image_show_detail.click();







No comments:

Post a comment