I am trying to click on sign out link, but not able to succeed: I tried the below ways,
Click Element class=mat-icon.notranslate.mat-primary.material-icons Click Button name=Sign Out Click Element name=Sign Out
However, this is a symptom of a problem: Angular applications have a custom DOM structure that is not supported properly by WebDriver. Protractor provides the support for Angular E2E automated checking.
It looks like you are targeting an element with the name of "Sign Out". However, from the code snippet, there is no element with the name "Sign Out". The name attribute is not on the tag.
If this is the only element with this class, you can try:
Click Element class=mat-menu-item
Or, since it's a link:
Click Element link=Sign Out
You can also try to use a CSS Selector or an Xpath to target this element.
Hi sometimes click action does not work on all elements, try clicking the parent element:
Also your page is angular , and hence might works asynchronously. So try waiting for element
wait until page contains element css:*[class="mat-menu-item"] Click Element css:*[class="mat-menu-item"]
Or any parent element up in the hierarchy
Usually click works in elements like input, button, and elements with clickable property for angular pages