Selenium.WebDriver.ChromeDriver初始启动时速度慢

时间:2018-03-01 18:34:28

标签: c# selenium selenium-webdriver selenium-chromedriver launching

Chrome驱动程序的初始启动平均需要35秒,一切正常,只是可以加快启动时间。使用Selenium.WebDriver.ChromeDriver版本2.35,Jsakamoto的NuGet。其他nuget包是由Selenium Committers提供的Selenium.support 3.9.1和selenium.webdriver 3.9.1。如何加快ChromeDriver的首次启动速度?

  [TestMethod, TestCategory("DriverSpeed"), TestCategory("GUI")]
        public void SpeedingUpOption()
        {
            Stopwatch time = new Stopwatch();
            time.Start();
            ChromeOptions options = new ChromeOptions();

            // Tried many options nothing helped

            IWebDriver driver = new ChromeDriver(options);
            driver.Navigate().GoToUrl("http://www.google.com");
            time.Stop();
            IWebElement searchBox = driver.FindElement(By.Name("q"));
            searchBox.SendKeys("ChromeDriver Slow");
            driver.Dispose();
        }

0 个答案:

没有答案