On a web page, I am able to perform the right click on a link but not able to select the first option which is 'Open link in a new tab'.
Following are the details:
Selenium WebDriver - v3.14.0
Selenium WebDriver Support - v3.14.0
Chrome Driver - v2.41.0
Visual Studio 2017 in Windows 10 (Selenium C#)
Chrome Browser - 69.0.3497.100 (64 Bit)
Please let me know how to handle this. I have searched this forum but I got results related to Firefox only.
Below is the code I am using:
public void RightClickByXPathAndSelectOption(string webElementXPath)
{
Actions action = new Actions(driver);
action.ContextClick(driver.FindElement(By.XPath(webElementXPath))).SendKeys(Keys.ArrowDown).SendKeys(Keys.Enter).Build().Perform();
}