Issue
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.
Solution
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
Answered By - undetected Selenium
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.