本文整理汇总了C#中IWebDriver.GetNuGetChromeDriver方法的典型用法代码示例。如果您正苦于以下问题:C# IWebDriver.GetNuGetChromeDriver方法的具体用法?C# IWebDriver.GetNuGetChromeDriver怎么用?C# IWebDriver.GetNuGetChromeDriver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWebDriver
的用法示例。
在下文中一共展示了IWebDriver.GetNuGetChromeDriver方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDriverInstance
public IWebDriver CreateDriverInstance(string testName)
{
switch (browser)
{
case Browser.SauceLabs:
driver = WebDriverFactory.GetSauceDriver(testName, remoteBrowserName, remoteBrowserVersion, remoteOsPlatform);
break;
case Browser.Remote:
//Todo start localy if not already running
//throw new NotImplementedException();
driver = WebDriverFactory.GetRemoteWebDriver();
break;
case Browser.Chrome:
if (!driver.GetNuGetChromeDriver()) throw new DriverServiceNotFoundException();
driver = WebDriverFactory.GetBrowser<ChromeDriver>();
break;
case Browser.Firefox:
if (!driver.DownloadGeckoDriver()) throw new DriverServiceNotFoundException();
driver = WebDriverFactory.GetBrowser<FirefoxDriver>();
break;
case Browser.IE:
if (!driver.GetNuGetIEDriver()) throw new DriverServiceNotFoundException();
driver = WebDriverFactory.GetBrowser<InternetExplorerDriver>();
break;
default:
throw new NotSupportedException();
}
return driver;
}