IAdapter
IAdapter

Reputation: 64807

How to xpath for element with two possible last element?

I have complex xpath selector. I want to make it generic, so it could point to input and textarea.

example xpath's

//someelement//input

//someelement//textarea

how to merge those two into single xpath?

Upvotes: 1

Views: 166

Answers (1)

BeniBela
BeniBela

Reputation: 16927

You can use an union:

 //someelement//input  | //someelement//textarea

Or in XPath 2:

//someelement//(input, textarea)

Upvotes: 5

Related Questions