Using an OR condition in Xpath to identify the same element

If the element has two xpath, then you can write two xpaths like below

xpath1 | xpath2

Eg: //input[@name="username"] | //input[@id="wm_login-username"]

It will choose any one xpath

Leave a Comment