Reputation: 20192
I need to click on a button using selenium (java server) - the button only has a type and no id/value. Any helpful suggestions would be most welcome
<button type="submit">Enter</button>
Upvotes: 0
Views: 1139
Reputation: 8531
Another option is //button[contains(text(),'Enter')], though this would break if you have localized sites..
Upvotes: 1
Reputation: 20192
The following worked for me:
selenium.click("//button[@type='submit']"
Upvotes: 0