Exemple #1
0
        /// <summary>
        /// Log info about the web driver setup
        /// </summary>
        protected override void PostSetupLogging()
        {
            try
            {
                IWebDriver driver = Extend.GetLowLevelDriver(this.WebDriver);
                string     browserType;

                // Get info on what type of brower we are using
                if (driver is RemoteWebDriver)
                {
                    browserType = ((RemoteWebDriver)driver).Capabilities.ToString();
                }
                else
                {
                    browserType = driver.GetType().ToString();
                }

                if (SeleniumConfig.GetBrowserName().Equals("Remote", StringComparison.CurrentCultureIgnoreCase))
                {
                    this.Log.LogMessage(MessageType.INFORMATION, "Remote driver: " + browserType);
                }
                else
                {
                    this.Log.LogMessage(MessageType.INFORMATION, "Local driver: " + browserType);
                }

                this.WebDriver.SetWaitDriver(SeleniumConfig.GetWaitDriver(this.WebDriver));
            }
            catch (Exception e)
            {
                this.Log.LogMessage(MessageType.ERROR, "Failed to start driver because: {0}", e.Message);
                Console.WriteLine(StringProcessor.SafeFormatter("Failed to start driver because: {0}", e.Message));
            }
        }
Exemple #2
0
 /// <summary>
 /// The default get web driver function
 /// </summary>
 /// <returns>The web driver</returns>
 protected virtual IWebDriver GetBrowser()
 {
     return(SeleniumConfig.Browser());
 }