public void open(string path, string className) { Uri uriResult; bool result = Uri.TryCreate(path, UriKind.Absolute, out uriResult) && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps); if (result) { Controller = controllerType.SELENIUM; if (sc == null) { sc = new SeleniumController(); } sc.open(path); } else { Controller = controllerType.AUTOIT; aic = new AutoItController(); aic.open(path, className); } }
public void init(string type, string browserType) { if (type.ToUpper() == "SELENIUM") { try { sc = new SeleniumController((SeleniumController.BrowserType)Enum.Parse(typeof(SeleniumController.BrowserType), browserType)); } catch (ArgumentException) { Console.WriteLine("Invalid browser type:" + browserType); } } else { throw new NotImplementedException(); } }