javascript - Protractor: element.getText() returns an object and not String -
i have element defined this.clientrowname = element(by.id('client_name')); //page object file i want read text in element "abc" doing: var client = page.clientrowname.gettext(); returns object instead of string. there other way can text element gettext() returns promise , need resolve it: page.clientrowname.gettext().then(function (text) { console.log(text); }); or, if want assert text, let expect() resolve promise you: expect(page.clientrowname.gettext()).toequal("abc"); promises , control flow documentation page should clear things up.