I'm struggling to get a handle on a button. Would anyone be able to point me in the right direction on how to get a handle on the button AND click on it using xpath or a css selector? Here is the code:
<button class="trans-button mtrn-dialog-button" title="" value="">OK</button>
I have tried to get it by text. It seems to work fine (in that it can find the element) but it doesn't seem to want to provide the click event to the button
Using the following Xpath expression (Inner Text) should allow you click the button
IWebELement okButton = aDriver.FindElement(By.XPath("//button[.='OK']"));
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