I have this logic which gets the current page\'s title first clicks on next button, fetches the title again and if both the titles are the same, meaning navigation has not m
You can use or operator like
or
(.//span[@class='g-title'])[2] or .//span[@class='g-title']
For more details : Two conditions using OR in XPATH