public class Factory
{
public static IWebDriver Driver;
public static void CreateDriverInstance(string browserType)
{
if (browserType.Equals("Firefox"))
{
Driver = new FirefoxDriver();
}
else if (browserType.Equals("IE"))
{
Driver = new InternetExplorerDriver();
}
else if (browserType.Equals("Chrome"))
{
Driver = new ChromeDriver();
}
Driver.Manage().Window.Maximize();
Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
Driver.Navigate().GoToUrl("http://www.google.com");
}
{
public static IWebDriver Driver;
public static void CreateDriverInstance(string browserType)
{
if (browserType.Equals("Firefox"))
{
Driver = new FirefoxDriver();
}
else if (browserType.Equals("IE"))
{
Driver = new InternetExplorerDriver();
}
else if (browserType.Equals("Chrome"))
{
Driver = new ChromeDriver();
}
Driver.Manage().Window.Maximize();
Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
Driver.Navigate().GoToUrl("http://www.google.com");
}
0 comments