static void Main(string[] args) { DUMMYSITE_TEST_CASES tests = new DUMMYSITE_TEST_CASES(); tests.TestCase1(); tests.TestCase2(); tests.TestCase3(); SeleniumLog log = SeleniumLog.Instance(); log.Info("Test info"); log.Warning("Test warning"); log.Pass("Test pass"); log.Fail("Test fail"); log.Debug("Test debug"); }
private void SelectFlight(string FROM, string TO, int FLIGHTNUM) { SeleniumLog log = SeleniumLog.Instance(); log.Info("Choose " + FROM + " to " + TO); SelectElement fromSelect = new SelectElement(pom.p1.FromCountry); fromSelect.SelectByValue(FROM); SelectElement toSelect = new SelectElement(pom.p1.ToCountry); toSelect.SelectByValue(TO); log.Info("Click on Choose Flights button"); pom.p1.FindFlights.Click(); log.Info("Choose Flight number " + FLIGHTNUM); pom.p2.GetChooseFlightButton(FLIGHTNUM).Click(); log.Info("Enter payment details"); pom.p3.Name.SendKeys("James Ni"); log.Info("Click on Purchase button"); pom.p3.Purchase.Click(); log.Info("OK Alert"); log.Config.OnWebdriverExceptionThrown_LogEvent = false; WebDriverWait wait = new WebDriverWait(driver1, TimeSpan.FromSeconds(10)); IAlert alert = wait.Until(ExpectedConditions.AlertIsPresent()); alert.Accept(); log.Config.OnWebdriverExceptionThrown_LogEvent = true; log.Info("Click Home button"); pom.p3.Home.Click(); }