# Unable to locate button element

**URL:** <https://forum.robotframework.org/t/unable-to-locate-button-element/3355>\
**Category:** SeleniumLibrary\
**Created:** [1 March 2022 15:59 UTC](https://forum.robotframework.org/t/unable-to-locate-button-element/3355 "2022-03-01T15:59:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![resourceful-idiot](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@resourceful-idiot](https://forum.robotframework.org/u/resourceful-idiot)\
**Post date:** [1 March 2022 15:59 UTC](https://forum.robotframework.org/t/unable-to-locate-button-element/3355/1 "2022-03-01T15:59:43Z")

</div>

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

```
/html/body/app-root/body/div/div[1]/app-site-header/div/div[2]/div[2]/p-menubar/div/p-menubarsub/ul

```

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

//\*[contains(@class,“my-menu-icon”)]/html/body/app-root/body/div/div[1]/app-site-header/div/div[2]/div[2]/p-menubar/div/p-menubarsub/ul

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.

Env.

Python 3.6.7

---

<div class="post-metadata">

**Author:** ![EdManlove](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/edmanlove/32/1002_2.png) [@EdManlove](https://forum.robotframework.org/u/EdManlove)\
**Post date:** [1 March 2022 20:44 UTC](https://forum.robotframework.org/t/unable-to-locate-button-element/3355/2 "2022-03-01T20:44:21Z")

</div>

> [@resourceful-idiot](#):
>
> error “button with locator not found”

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.
