Recently, I began learning protractor and encountered some difficulties extracting text from a DOM object.
Here is a snippet of code from an AngularJS application:
"<div class="input-group application-item-field">
<input type="text" class="form-control ng-pristine ng-valid ng-touched" id="symbol" ng-model="ctrl.getApplication().company.symbol">
</div>"
I am attempting to retrieve the text from the symbol object, but it is not appearing in the span.
I attempted the following method:
element(By.model('ctrl.getApplication().company.symbol')).getAttribute('class').then(function(text){
console.log(text);
});
However, this did not return the text as expected.
I was able to retrieve the text value by using
console.log(document.getElementById('symbol').value);
in the developer tools.
Your advice on resolving this issue would be greatly appreciated.