[Fixed] Protractor – Find an element in a mat-list

Issue

I’m doing some automation tests with protractor and I am stuck with a case.
I want to find a mat-list-item that contains a particular text, in this case "Automation A".

enter image description here

Solution

element(by.xpath('//mat-list-item[contains(.,"Automation A")]'))

Leave a Reply

(*) Required, Your email will not be published