1

Is this the correct way to find the element using two different texts, since that element has two different texts for two different environments.

.find(div).withText(/text1 || text2/)

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
chris
  • 119
  • 1
  • 6

1 Answers1

1

The way to use regular expressions is valid. However, the regular expression is not correct. It should be the following:

.withText(/text1|text2/)

See also: Regex match one of two words

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47