-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,824
  • 17
  • 99
  • 186
Pramodya Mendis
  • 686
  • 8
  • 24

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
  • 32,888
  • 5
  • 17
  • 41