2

I'm trying to find this specific button. I've tried using find button in capybara to do this but I'm unable to.

find(:button, 'Open Cow menu').click

HTML Tag

<button class="cd-icon-button cd-button cd-irx-cyan-theme" type="button" ng-transclude="" aria-label="Open Cow menu" ng-click="$mdMenu.open($event)" aria-haspopup="true" aria-expanded="false" aria-owns="menu_container_1">
        <i class="fa fa-ellipsis-h" aria-hidden="true"></i>
    </button>

I'm sure there is a easier way of doing this.

Rubyman543
  • 165
  • 5

1 Answers1

1

Open Cow menu is the value of the aria-label attribute.

So you can use either of the following Locator Strategies:

find('button[aria-label=Open Cow menu]').click

or

find('button[aria-label="Open Cow menu"]').click
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352