[SetUp] //runs before each test
        //[OneTimeSetUp]    //runs one time before all tests
        public void Setup()
        {
            var browserType = TestContext.Parameters.Get("Browser", "Chrome");        //default value if not specified when running the test from command line

            _browserType = (BrowserType)Enum.Parse(typeof(BrowserType), browserType); //(BrowserType) cast to BrowserType
            ChooseDriverInstance(_browserType);

            //Driver = new ChromeDriver();    //create new instance of chromdriver
            //Driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30);

            Driver.Manage().Window.Maximize();  //maximize window
            //Driver.Navigate().GoToUrl("http://demosite.casqad.org/");

            TestObject = MyTestData.LoadTestDataFromFile()
                         .First(obj => obj.TestCaseName == TestContext.CurrentContext.Test.MethodName);
        }
Beispiel #2
0
 public void Setup()
 {
     Driver     = new ChromeDriver();
     TestObject = MyTestData.LoadTestDataFromFile()
                  .First(obj => obj.TestCaseName == TestContext.CurrentContext.Test.MethodName);
 }