public WebDriver(IAsyncWebBrowserClient client) { browserClient = client; Mouse = browserClient.Mouse; Keyboard = browserClient.Keyboard; appPath = Path.GetDirectoryName(typeof(WebDriver).Assembly.Location); }
private async void OpenTab_Button_Click_11(object sender, RoutedEventArgs e) { try { IAsyncWebBrowserClient browserClient = null; DriverConfig config = null; if (chbOpenProfileHeadless.IsChecked == true) { var(width, height) = GetWidthHeight(); // one config for all or config = new DriverConfig().SetHeadless().SetWindowSize(width, height); } else { config = new DriverConfig(); } if (rbOpenFirefox.IsChecked == true) { asyncFirefoxDriver = new AsyncFirefoxDriver(config); browserClient = asyncFirefoxDriver; } else if (rbOpenChrome.IsChecked == true) { asyncChromeDriver = new AsyncChromeDriver(config); browserClient = asyncChromeDriver; } else if (rbOpenOpera.IsChecked == true) { asyncOperaDriver = new AsyncOperaDriver(config); browserClient = asyncOperaDriver; } webDriver = new WebDriver(browserClient); driversToClose.Add(webDriver); //await asyncFirefoxDriver.Connect(); // browser opens here await webDriver.GoToUrl("https://www.bing.com/"); // browser opens here var mess = $"opened on port {config.Port} in dir {config.UserDir} \nWhen close, dir will be DELETED"; tbDevToolsRes2.Text = mess; } catch (Exception ex) { tbDevToolsRes2.Text = ex.ToString(); } }
public ZuRequestListener(IAsyncWebBrowserClient browserClient) { this.browserClient = browserClient; }
public WebDriver(IAsyncWebBrowserClient client) { browserClient = client; appPath = Path.GetDirectoryName(typeof(WebDriver).Assembly.Location); }