/// <summary> /// Extracts Data from excel. /// </summary>LoadTestConfigurations /// <param name="errorMessage">Error message.</param> /// <returns>False if no error.</returns> public static bool InitiliazeTestCaseAndTestData(ref string errorMessage) { var applicationClass = new ApplicationClass(); try { TestCase.UiControls = new List <UiControl>(); TestCase.Verifications = new List <Verification>(); ConfigName.TestConfigNames = new List <ConfigStep>(); TestCase.TestStepList = new List <TestStep>(); LoadUiControls(applicationClass); LoadVerifications(applicationClass); LoadTestConfigurations(applicationClass); TestConfigurations.Configuration(); LoadTestCases(applicationClass); return(true); } catch (Exception ex) { errorMessage = ex.Message; LogHelper.ErrorLog(ex, Entities.Constants.ClassName.Data, MethodBase.GetCurrentMethod().Name); return(false); } finally { WorkBookUtility.CloseExcel(applicationClass); } }
public static IWebDriver GetInstance() { //driver = TestConfigurations.Browser; if (driver == null) { TestConfigurations configs = TestConfigurations.GetInstance(); if (TestConfigurations.browser == chrome) { driver = new ChromeDriver(); } else if (TestConfigurations.browser == firefox) { driver = new FirefoxDriver(); } else if (TestConfigurations.browser == internetExplorer) { driver = new InternetExplorerDriver(); } else { throw new Exception("Not valid browser in configss"); } } return(driver); }
override public void OneTimeSetUp() { TestConfigurations configs = TestConfigurations.GetInstance(); homePage = Navigator.OpenHomePage(driver); homePage.SelectUkrLanguageButton.Click(); translatePage = Navigator.OpenTranslatePage(driver); }
private IServiceProvider GetServiceProvider(ITestOutputHelper output) { var services = new ServiceCollection(); var configuration = TestConfigurations.GetConfiguration(); services.AddSingleton(configuration); services.AddLogging(b => b.AddXunit(output)); services.AddAuthorizeNet(); return(services.BuildServiceProvider()); }
public Form1() { InitializeComponent(); try { XElement element = XElement.Load(TestConfigurations.DefaultTestConfigFilePath); this.configurations = TestConfigurations.ReadFromXml(element); this.defaultTenantConfiguration = this.configurations.TenantConfigurations.Single(c => c.TenantName == this.configurations.TargetTenantName); } catch (System.IO.FileNotFoundException) { throw new System.IO.FileNotFoundException("To run tests you need to supply a TestConfigurations.xml file with credentials in the Test/Common folder. Use TestConfigurationsTemplate.xml as a template."); } }
public static IWebDriver GetInstance() { //driver = TestConfigurations.Browser; if (driver == null) { TestConfigurations configs = TestConfigurations.GetInstance(); if (TestConfigurations.Browser == chrome) { driver = new ChromeDriver(); } else if (TestConfigurations.Browser == firefox) { driver = new FirefoxDriver(); } else if (TestConfigurations.Browser == internetExplorer) { //InternetExplorerOptions internetExplorerOptions = new InternetExplorerOptions(); //internetExplorerOptions.IgnoreZoomLevel = true; //internetExplorerOptions.IntroduceInstabilityByIgnoringProtectedModeSettings = true; //internetExplorerOptions.ForceCreateProcessApi = true; //internetExplorerOptions.BrowserCommandLineArguments = "--port=5555"; //internetExplorerOptions.EnsureCleanSession = true; driver = new InternetExplorerDriver(@"C:\Sources\"); //InternetExplorerDriverService internetExplorerDriverService = InternetExplorerDriverService.CreateDefaultService(); //internetExplorerDriverService.Port = 5555; //return new InternetExplorerDriver(@"C:\Sources\"); } else { throw new Exception("Not valid browser in configss"); } } return(driver); }
private static void Initialize(TestConfigurations configurations) { TestBase.TargetTenantConfig = configurations.TenantConfigurations.Single(config => config.TenantName == configurations.TargetTenantName); TestBase.StorageCredentials = new StorageCredentials(TestBase.TargetTenantConfig.AccountName, TestBase.TargetTenantConfig.AccountKey); TestBase.CurrentTenantType = TargetTenantConfig.TenantType; }
public TransactionClientTests(ITestOutputHelper output) { _output = output; _configuration = TestConfigurations.GetConfiguration(); }