I need to extract a text from the code snippet below (Using Protractor)
<mat-chip>
<div class="mat-chip-ripple"></div>
"Text to print'
<mat-icon>cancel</mat-icon>
</mat-chip>
I want to my function to return 'Text to print' only. Doing a getText() on element gives me 'Text to Print' and 'cancel' too.
Other options I tried was elem.getAttribute('innerHTML') & 'innerText' - none provided me the answer I was looking for