/// <summary> /// Initializes a new instance of the <see cref="SeleniumTesterBase"/> class. /// </summary> /// <param name="testCaseName">Name of the test case.</param> public SeleniumTesterBase(string testCaseName) : base(testCaseName) { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); browserType = (BrowserType)Enum.Parse( typeof(BrowserType), ConfigurationManager.AppSettings["BrowserType"], true); testMachine = ConfigurationManager.AppSettings["TestMachine"]; seleniumPort = int.Parse( ConfigurationManager.AppSettings["SeleniumPort"], CultureInfo.InvariantCulture); seleniumSpeed = ConfigurationManager.AppSettings["SeleniumSpeed"]; browserUrl = ConfigurationManager.AppSettings["BrowserUrl"]; string browserExe; switch (browserType) { case BrowserType.InternetExplorer: browserExe = "*iexplore"; break; case BrowserType.Firefox: browserExe = "*firefox"; break; default: throw new NotSupportedException(); } selenium = new DefaultSelenium(testMachine, seleniumPort, browserExe, browserUrl); selenium.Start(); Console.WriteLine("Started Selenium session (browser type={0})", browserType); // sets the speed of execution of GUI commands if (false == String.IsNullOrEmpty(seleniumSpeed)) { selenium.SetSpeed(seleniumSpeed); } }