public IWebBrowser Create(BrowserType browserType, BrowserStartOptions startOptions, IEnumerable <IBusyCondition> busyConditions)
        {
            IWebDriver webDriver   = null;
            string     driversPath = Path.Combine(Environment.CurrentDirectory, "Drivers");

            switch (browserType)
            {
            case BrowserType.Chrome:
                webDriver = ChromeDriverFactory.Create(driversPath, startOptions);
                break;

            case BrowserType.InternetExplorer:
                webDriver = InternetExplorerDriverFactory.Create(driversPath, startOptions);
                break;

            default:
                throw new NotSupportedException();
            }

            SeleniumWebBrowser browser = new SeleniumWebBrowser(
                webDriver: webDriver,
                browserType: browserType,
                busyConditions: busyConditions ?? new List <IBusyCondition>());

            return(browser);
        }
Beispiel #2
0
 public SeleniumControlFinder(ISearchContext elementScope, SeleniumWebBrowser webBrowser)
 {
     this._elementScope = elementScope;
     this._webBrowser   = webBrowser;
 }
Beispiel #3
0
 public SeleniumJsExecutor(SeleniumWebBrowser webBrowser)
 {
     this._javascriptExecutor = (IJavaScriptExecutor)webBrowser.WebDriver;
 }
Beispiel #4
0
 public SeleniumControlFinder(SeleniumWebBrowser webBrowser) : this(webBrowser.WebDriver, webBrowser)
 {
 }