public IWebDriver Init(string profile, string environment)
        {
            NameValueCollection caps     = ConfigurationManager.GetSection("capabilities/" + profile) as NameValueCollection;
            NameValueCollection settings = ConfigurationManager.GetSection("environments/" + environment) as NameValueCollection;

            DesiredCapabilities capability = new DesiredCapabilities();

            foreach (string key in caps.AllKeys)
            {
                capability.SetCapability(key, caps[key]);
            }

            foreach (string key in settings.AllKeys)
            {
                capability.SetCapability(key, settings[key]);
            }

            var username = AzureConfig.GetConfig().BrowserStackUser;

            var accesskey = AzureConfig.GetConfig().BrowserStackKey;

            capability.SetCapability("browserstack.user", username);
            capability.SetCapability("browserstack.key", accesskey);
            capability.SetCapability("project", "das-psrs");
            capability.SetCapability("build", "build x.x");

            File.AppendAllText("C:\\Users\\Matt\\Desktop\\sf.log", "Starting local");

            if (capability.GetCapability("browserstack.local") != null && capability.GetCapability("browserstack.local").ToString() == "true")
            {
                browserStackLocal = new Local();
                List <KeyValuePair <string, string> > bsLocalArgs = new List <KeyValuePair <string, string> >()
                {
                    new KeyValuePair <string, string>("key", accesskey)
                };
                browserStackLocal.start(bsLocalArgs);
            }

            File.AppendAllText("C:\\Users\\Matt\\Desktop\\sf.log", "Starting driver");
            driver = new RemoteWebDriver(new Uri("http://" + ConfigurationManager.AppSettings.Get("BrowserStack.Server") + "/wd/hub/"), capability);
            return(driver);
        }
Example #2
0
 public string GetDBConnectionString()
 {
     return(AzureConfig.GetConfig().ConnectionString);
 }
Example #3
0
 public TestUser GetViewUser()
 {
     return(AzureConfig.GetConfig().ViewAccessUser);
 }
Example #4
0
 public TestUser GetEditUser()
 {
     return(AzureConfig.GetConfig().EditAccessUser);
 }
Example #5
0
 public TestUser GetSuperUser()
 {
     return(AzureConfig.GetConfig().SubmitAccessUser);
 }
Example #6
0
 public string GetEmployerId()
 {
     return(AzureConfig.GetConfig().EmployerId);
 }