You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
header_PersonName: {// This is how to find the actual header element.get: function(){returnthis.findElements(this.by.binding('{{header.displayName}}'));}},getPersonName: {value: function(){// This uses the element from above and gets the first element from it.returnthis.header_PersonNames.then(function(elems){returnelems[0];});}}
Let me know if that works.
Ok, I'm pretty sure that won't work.
I think your problem is that your trying to make a web element selector that uses findElements, and then you're turning around and returning the first element. When you do that, you force the evaluation of the promise inside of astrolabe, and it in turn gives you back a web element.
You need to avoid evaluating the promise here. This should work:
My test:
expect(page.header_PersonName).toBeDefined();
When I run protractor I get this error:
Error: expect called with WebElement argment, expected a Promise. Did you mean to use .getText()?
Thanks for any help.
The text was updated successfully, but these errors were encountered: