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