I'm writing an automated test for a page where the contents are partially randomized: the text of an element will be one of a known set of possibilities.
I want to write an XPath selector that says: "there's an <h3> whose contents are either Foo or Bar or Baz".
How would I do that?
I think I need a regular expression and matches. I've tried //h3[matches(text(), 'Foo|Bar|Baz|')]', but the library I'm using says that's not a valid query. (I don't know what version of XPath it uses.)
//h3[text() = 'Foo' or text() = 'Bar' or text() = 'Baz']– Wiktor Stribiżew Oct 30 '17 at 13:42