Unable to locate button element

I get error “button with locator not found” when using this xpath


I’ve tried clicking it using class locator, the HTML is

<span class="p-menuitem-icon  my-menu-icon  ng-star-inserted"></span>

My code


This does not work either. I’ve also tried:

Wait Until Page Contains
Wait Until Element Is Visible
Wait Until Page Contains Element

Everything else is working so I know my environment should be ok.


Python 3.6.7

This error to me is indicating that you are using a Click Button keyword which expects either an input html element or a button html element. If, as seen in the sample html given, the element is an unorder list (<ul>) or span then Click Button would fail. Try the generic Click Element keyword instead.

1 Like