Protractor: element.getText() returns an object but not String [duplicate]
问题 This question already has answers here : Protractor: element.getText() returns an object and not String (3 answers) Closed 3 years ago . I have also checked link: Protractor: element.getText() returns an object and not String but i found no answer for that on above link and i want string in return?? 回答1: All the protractor's methods return promises, to resolve that promise you need to send something like this: element.getText().then(function(text) { console.log(text); }); or use "expect"--