Esempio n. 1
0
 public WebDriver(WebDriverConfig webDriverConfig)
 {
     Config = webDriverConfig;
     _driver = webDriverConfig.CreateDriver();
     _javaScriptExecutor = new JavaScriptExecutor(_driver);
     _wait = new WebDriverWait(_driver, webDriverConfig.WaitTimeout);
 }
Esempio n. 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;
     });
 }
Esempio n. 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);
     });
 }
Esempio n. 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;
     });
 }