I have a driver same code as below. And now I want to open a new tab and navigate my new tab to another url. But I get one Error
System.InvalidOperationException: missing field
handle
at line 3 column 1
DesiredCapabilities Capabilities = new DesiredCapabilities();
Capabilities.SetCapability(CapabilityType.BrowserName, "firefox");
string GridURL = "http://localhost:4545/wd/hub";
Driver = new RemoteWebDriver(new Uri(GridURL), Capabilities);
Driver.Navigate().GoToUrl("http://URL1.com");
IJavaScriptExecutor js = (IJavaScriptExecutor)Driver;
js.ExecuteScript("window.open('URL2.com', '_blank');");
// this line have error
//System.InvalidOperationException: missing field `handle` at line 3 column 1
Driver.SwitchTo().Window(Driver.WindowHandles.First());