public void Setup() { string _executionPath = Environment.CurrentDirectory; string _rootPath = Path.GetFullPath(Path.Combine(_executionPath, @"..\..")); _driver = new ChromeDriver(Path.Combine(_rootPath, @"Packages\")); //_driver.Manage().Window.Size = new Size(1500, 800); Context = SeleniumContext.CreateContext(_driver); StartTime = DateTime.Now; if (SeleniumConfiguration.DBLogging) { RunID = Context.RegisterTest(GetType().Name, StartTime.ToString()); } else { RunID = "1"; } Status = true; /* * try * { * var Authenticate = new Authentication(); * Authenticate.BaseUrl = SeleniumConfiguration.Current.BaseURL; * Authenticate.LoginUrl = SeleniumConfiguration.Current.LoginURL; * Authenticate.UserName = SeleniumConfiguration.Current.Username; * Authenticate.Password = SeleniumConfiguration.Current.Password; * Authenticate.ProxyUserName = SeleniumConfiguration.Current.ProxyUsername; * Authenticate.ProxyPassword = SeleniumConfiguration.Current.ProxyPassword; * * Authenticate.RunCase(); * } * catch (Exception ex) * { * Console.WriteLine("Authentication Failed."); * } */ }
public static SeleniumContext CreateContext(ChromeDriver driver) { Current = new SeleniumContext(driver); return(Current); }