public UCIBrowser GetBrowser(BrowserOptions options, BrowserLoginDetails browserLoginDetails) { Logger.WriteLine("Getting Browser"); if (!_browserCache.TryGetValue(options.BrowserType, out var dic)) { Logger.WriteLine($"No browser for {options.BrowserType} doesn't exist. Creating new list"); dic = new Dictionary <string, UCIBrowser>(); _browserCache.Add(options.BrowserType, dic); } if (!dic.TryGetValue(browserLoginDetails.Username, out UCIBrowser browser)) { Logger.WriteLine($"Browser for {browserLoginDetails.Username} doesn't exist. Creating new browser session"); if (string.IsNullOrEmpty(options.DriversPath)) { options.DriversPath = GetDriverPath(options); } browser = new UCIBrowser(options, _buttonTexts, _appCache.Value); dic.Add(browserLoginDetails.Username, browser); browser.Login(browserLoginDetails); } return(browser); }
public FormData OpenCreatedRecord(UCIBrowser browser, string childEntityName) { _app.Client.Execute(BrowserOptionHelper.GetOptions("Open Quick Create Child"), (driver) => { driver.WaitUntilClickable( SeleniumFunctions.Selectors.GetXPathSeleniumSelector(SeleniumSelectorItems.Entity_QuickCreate_OpenChildButton), TimeSpan.FromSeconds(5), null, () => throw new TestExecutionException(Constants.ErrorCodes.QUICK_CREATE_CHILD_NOT_AVAILABLE)).Click(); HelperMethods.WaitForFormLoad(driver, new FormIsOfEntity(childEntityName)); return(true); });
public UCIBrowser GetBrowser(BrowserOptions options, UserDetails userDetails, Uri uri) { Logger.WriteLine("Getting Browser"); if (!_browserCache.TryGetValue(options.BrowserType, out var dic)) { Logger.WriteLine($"No browser for {options.BrowserType} doesn't exist. Creating new list"); dic = new Dictionary <string, UCIBrowser>(); _browserCache.Add(options.BrowserType, dic); } if (!dic.TryGetValue(userDetails.Username, out UCIBrowser browser)) { Logger.WriteLine($"Browser for {userDetails.Username} doesn't exist. Creating new browser session"); browser = new UCIBrowser(options, _buttonTexts, _appCache.Value); dic.Add(userDetails.Username, browser); browser.Login(uri, userDetails); } return(browser); }