示例#1
0
文件: WebDriver.cs 项目: IIITanbI/1
 public WebDriver(WebDriverConfig webDriverConfig)
 {
     Config = webDriverConfig;
     _driver = webDriverConfig.CreateDriver();
     _javaScriptExecutor = new JavaScriptExecutor(_driver);
     _wait = new WebDriverWait(_driver, webDriverConfig.WaitTimeout);
 }
示例#2
0
 public WebDriverManager(WebDriverConfig config)
 {
     Config = config;
     _container = new ThreadLocal<LocalContainer>(() =>
     {
         var cont = new LocalContainer();
         cont._driver = Config.CreateDriver();
         cont._javaScriptExecutor = new JavaScriptExecutor(cont._driver);
         cont._wait = new WebDriverWait(cont._driver, Config.WaitTimeout);
         return cont;
     });
 }
示例#3
0
 public WebDriverManager(WebDriverConfig config)
     : base(config)
 {
     Config     = config;
     _container = new ThreadLocal <LocalContainer>(() =>
     {
         var cont                = new LocalContainer();
         cont.Driver             = Config.CreateDriver();
         cont.Wait               = new WebDriverWait(cont.Driver, Config.WaitTimeout);
         cont.JavaScriptExecutor = cont.Driver as IJavaScriptExecutor;
         if (cont.JavaScriptExecutor == null && Config.IsJavaScriptEnabled)
         {
             throw new TestLibsException($"Can't initialize JavaScript executor for WebDriver: {cont.Driver}");
         }
         return(cont);
     });
 }
示例#4
0
 public WebDriverManager(WebDriverConfig config)
     : base(config)
 {
     Config = config;
     _container = new ThreadLocal<LocalContainer>(() =>
     {
         var cont = new LocalContainer();
         cont.Driver = Config.CreateDriver();
         cont.Wait = new WebDriverWait(cont.Driver, Config.WaitTimeout);
         cont.JavaScriptExecutor = cont.Driver as IJavaScriptExecutor;
         if (cont.JavaScriptExecutor == null && Config.IsJavaScriptEnabled)
         {
             throw new TestLibsException($"Can't initialize JavaScript executor for WebDriver: {cont.Driver}");
         }
         return cont;
     });
 }