i try this codes and open mozila firefox the get google.com site but never open new tab why?
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
namespace ConsoleApp5
{
class Program
{
static void Main(string[] args)
{
IWebDriver driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://google.com");
IWebElement element = driver.FindElement(By.TagName("Body"));
System.Threading.Thread.Sleep(6000);
element.SendKeys(OpenQA.Selenium.Keys.Control + "t");
}
}
}
and try this but it has never open new tab!
namespace ConsoleApp5
{
class Program
{
static void Main(string[] args)
{
IWebDriver driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://google.com");
var action = new Actions(driver);
System.Threading.Thread.Sleep(6000);
action.KeyDown(Keys.Control).SendKeys("t").Perform();
}
}
}