I'm trying to return the options present in the list using the below function.
HTML
<select>
<option>one</option>
<option>two</option>
<option>three</option>
<select>
Function
getValues(){
var ele = element(by.xpath("......../select"));
return ele.all(by.tagName('option')).getAttribute('value').getText().then(function (text){
for (var i = 0; i < text.length; i++) {
text[i] = text[i].trim();
}
return text;
});
}
When I print the values in console using console.log(getValues()), the console displays theManagedPromise{.....} function instead of options.
But I'm expecting the options as ["one","two","three"] array. Can anyone help me?