Summary : Link is not getting open in new tab.
Here is my code with the real url :-
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts(
First off, uninstall the existing Fire fox and delete the profile and then install the ESR version of Firefox, ESR version is must! To get the ESR version, simply type Firefox ESR in your google, that will pave the way for you to installation file.
Here is the code
FirefoxOptions foptions = new FirefoxOptions();
foptions.setCapability("marionette", false);
WebDriver driver = new FirefoxDriver(foptions);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.navigate().to("https://us.justdial.com/NY/New-York/Afghani-Restaurants/ct-16110200");
WebElement rightclickelement = driver.findElement(By.xpath("/html/body/div[1]/div[1]/div/section/div[5]/div[2]/div[2]/ul/li[1]/div/div[2]/h2/a"));
Actions action = new Actions(driver);
action.contextClick(rightclickelement).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ENTER).build().perform();