when i use text as follow , but it doesn't work
//button[contains(text(),"Project Association")]
how to get the element "button" with specific text in xpath 1.0
<div data-v-e252fc6a="" class="toolbar">
<button data-v-e252fc6a="" type="button" tabindex="1" class="aui-button aui-button--default">
<!---->
<!---->
<i data-v-e252fc6a="" class="aui-svg associate"></i>
"
Project Association
"
</button>
<button data-v-e252fc6a="" type="button" tabindex="1" class="aui-button aui-button--default">
<!---->
<!---->
<i data-v-e252fc6a="" class="aui-svg dissociate"></i>
"
Cancel Project Management
"
</button>
</div>
//button[contains(text(),"Project Association")]
Have you tried using the "Normalize-Space" element instead of your "contains" element?
I would suggest you try the following:
This should select the element with the text "Project Association" in your example code.
Otherwise you can try: