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/
)
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/
)
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