private SeleniumBrowser GetNewBrowser(TestInfo testInfo) { var browser = WebBrowserFactory.Create(testInfo.BrowserType, testInfo.BrowserHeader?.GetDictionary(), testInfo.Language, Thread.CurrentThread.ManagedThreadId); browser.HeaderSetup = testInfo.BrowserHeader; MainBrowsers.Add(browser); _logger.Info( $"[Browser:{browser.Id}] created with header '{browser.HeaderSetup?.CustomUserAgent}' with culture language '{browser.Language}' " + $"{(_logger.IsDebugEnabled ? $" and log Location='{browser.ProfileLocation}'" : string.Empty)}"); return(browser); }
private static List <IWebBrowser> GetWebBrowsers(ILogger logger, Uri testPageUrl, ClientTestRunConfiguration clientTestRunConfiguration, bool showTestingBrowserHost, string queryString, bool forceBrowserStart) { var webBrowserType = clientTestRunConfiguration.WebBrowserType; var webBrowserFactory = new WebBrowserFactory(logger); var testPageUrlWithQueryString = new Uri(testPageUrl + "?" + queryString); logger.Debug("testPageUrlWithQueryString = " + testPageUrlWithQueryString); List <IWebBrowser> webBrowsers = Enumerable .Range(1, clientTestRunConfiguration.NumberOfBrowserHosts) .Select(browserI => webBrowserFactory.Create(webBrowserType, testPageUrlWithQueryString, showTestingBrowserHost, forceBrowserStart, clientTestRunConfiguration.NumberOfBrowserHosts > 1)) .ToList(); return(webBrowsers); }
private IWebBrowser Create(string caption, string url, bool navigate) { frmWebBrowser frm = null; if (navigate) { frm = WebBrowserFactory.CreateAndBrowse(caption, url); } else { frm = WebBrowserFactory.Create(caption); } if (Program.MainForm.DockPanel.DocumentStyle == DocumentStyle.SystemMdi) { frm.MdiParent = Program.MainForm; frm.Show(); } else { frm.Show(Program.MainForm.DockPanel); } return(frm); }