I have the following element:
<button class="k-button k-button-icontext min-button-width" title="Add Matter (Access key + A)" onclick="addMatterToBill();return false;" accesskey="a">
<u>A</u>
dd Matter
How can I locate that element using c#? I have tried the following:
Driver.FindElement(By.Xpath("//input[@title= 'Add Matter (Access key + A)']")
and that did not work. I am not an expert at Xpath, so I better read/learn about it.
The actual text on the button is: Add Matter which is found in the above html between the <u>
.
Any help will be more welcome.
The target element is a button
, not an input
:
//button[@title = 'Add Matter (Access key + A)']
You may also check the title
attribute with starts-with()
:
//button[starts-with(@title, 'Add Matter')]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With