Code language c# Selenium Webdriver
I'm trying to open in chrome a new tab with the following code:
Actions action = new Actions(BrowserFactory.Driver);
action.SendKeys(Keys.Control + "T").Build().Perform();
string secondTabHandle = BrowserFactory.Driver.CurrentWindowHandle;
I found this code on stackoverflow.
I also tried:
IWebElement body =
BrowserFactory.Driver.FindElement(By.TagName("body"));
body.SendKeys(Keys.Control+'t');
body.SendKeys(Keys.Control+"t");
Thats also not working
Nothing happens after using this code.
Can someone help me what I am doing wrong.
Thanks in advance.