i have button for language change, I want to click on the button regardless of the button text. i am able to do it but separately for both EN and AR, is there a way write the ONE xpath that will work in these two condition.
//span[contains(text(),'الإنجليزية')]
//span[contains(text(),'AR')]
>Solution :
Yes, there is way you can use the below, this will work in both EN and AR.
//span[contains(text(),'الإنجليزية') or contains(text(),'AR')]
Also, you can learn it from
https://www.browserstack.com/guide/xpath-in-selenium