<button _ngcontent-c50="" class="mat-menu-item ng-star-inserted" mat-menu-item="" role="menuitem" tabindex="0" aria-disabled="false"> 11 - teste <div class="mat-menu-ripple mat-ripple" matripple=""></div></button>
代码水豚,经过测试
browser.find('button', text: ' 11 - teste ').click
find_button(' 11 - teste ')
find('#button.mat-menu-item').click
您是否尝试过使用指定的文本明确查找按钮?
find('button', text: '11 - teste')
取决于您的水豚版本,您还可以指定搜索为不完全:
find('button', text: '11 - teste', exact_text: false)