Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Beginner in automation, how to write xpath that will work in english and arabic both language,

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 :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading