In a Web page having the following xpaths.
xpath1 = By.xpath(".//*[@id='gamepackage-game-information']/article/div/div[2]/span")).getText();
xpath2 = By.xpath(".//*[@id='gamepackage-game-information']/article/div/div[1]/figure/figcaption/div")).getText();
Some webpages having xpath1
& Some webpages having xpath2
How to get the text using if condition in Selenium Webdriver?