1
<td style="width: 20px;">
  <IconButton [Name]="'Signout'" [IsIconOnly]="true (click)="OnSignoutClicked()" title="Sign Out"></IconButton>
</td>

How can I locate the above element in Protractor? I want to simulate a click on the element, not to expect it.

anasz3z3
  • 13
  • 1
  • 6

1 Answers1

1

You can get it by title:

$("IconButton[title='Sign Out']").click();
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • Thank you for your help, it worked perfectly . but if I can ask why this didn't work ? :: var SignOutbtn = element(by.css("img[src*='../Images/Icons/Signout.png']")); SignOutbtn.click(); – anasz3z3 Oct 04 '16 at 06:58
  • @anasz3z3 glad it worked. Difficult to say, I don't see the `img` tag in the HTML in the question.. – alecxe Oct 04 '16 at 11:53