-1

I want to access an element using selenium web driver using the inside text of a button element.

I want to catch this button element using "next" value.

<button>next</button>

How can I do this?

halfer
  • 19,471
  • 17
  • 87
  • 173
Pramodya Mendis
  • 687
  • 6
  • 19

1 Answers1

2

You can use following xpath options to get the element with text next

Option1:

//button[text()='next']

Option2:

//button[contains(.,'next')]

Option3:

//button[contains(text(),'next')]
KunduK
  • 29,126
  • 4
  • 11
  • 33