7.4.05.0.02.4.4chromeOSX Sierra 10.12.2let error = 'An error occurred loading that page. Please try again.';
let securityError = 'Request rejected. You do not have permission for the resource requested.';
let pageContainer = this.master.pageContainer();
pageContainer.isPresent().then((present) => {
console.log('expectNoErrorPage => present', present);
console.log('expectNoErrorPage', pageContainer);
if (!present) {
return;
}
// Works
pageContainer.getText().then((text) => console.log('expectNoErrorPage text', text));
// Boom
pageContainer.getInnerHtml().then((html) => console.log('expectNoErrorPage html', html));
// Original code that blows up below..
// expect(pageContainer.getInnerHtml()).not.toContain(error);
// expect(pageContainer.getInnerHtml()).not.toContain(securityError);
});
expectNoErrorPage => present true
expectNoErrorPage ElementFinder {
... lots of stuff
}
....
Failed: pageContainer.getInnerHtml is not a function
use .getInnerHtml() or .getOuterHtml()
Please read the changelog, this was covered as a breaking change as well as a work around.
@cnishina shame you can't do something to the typings and TS to highlight issues like that
What was the an actual reason those methods were removed from the Selenium WebDriver without replacements? Also curious, how can we update the public Any Angular 4 / protractor documentation to reflect the change. The ElementFinder API still states that this should be a working function.
So the changelog says, we have to replace all:
let i = element(locator).getInnerHtml();
by:
let i = browser.executeScript("return arguments[0].innerHTML;", element(locator));
I really really prefer the first form which was natural and fully comprehensive for human being. Is it possible to revert that removal ?
Coming back from the future it's seems that it's now possible to do:
let i = browser.element(locator).getAttribute('innerHTML')
(See https://stackoverflow.com/a/27571812/3482730)
Most helpful comment
So the changelog says, we have to replace all:
let i = element(locator).getInnerHtml();by:
let i = browser.executeScript("return arguments[0].innerHTML;", element(locator));I really really prefer the first form which was natural and fully comprehensive for human being. Is it possible to revert that removal ?