Having trouble capturing the text from a popup using Protractor with getText? The HTML structure can be found here. This popup only appears for a few seconds before disappearing. Can anyone assist me in retrieving the text from this popup?
To retrieve the message, you can use the following function:
var maxAgentCredit1 = element(by.xpath("//html/body/div/div/div/div[1]/div[2]/section/ng-view/div/div[2]/table/tbody/tr[3]/td[1]/a"));
var button = element(by.xpath("//*[@id='ngdialog1']/div[2]/div[1]/form/div/button[2]"));
maxAgentCredit1.click();
browser.sleep(1000);
button.click();
var until = protractor.ExpectedConditions;
browser.wait(until.presenceOf(popUpRep), 3000, 'Element taking too long to appear in the DOM');
element(by.css("p.ng-binding.ng-scope.notice.type-NOTICE.ng-animate.ng-leave.ng-leave-active")).getText().then(function (message) {
console.log(message);
});
}