public bool LoginRapidApplication_old(IWebDriver driver, string username, string password) { bool isLoggedIn = false; try { ManageWebDriver mDriver = new ManageWebDriver(); driver = mDriver.SetWebDriver(ConfigurationManager.AppSettings["default_browser"]); driver.Navigate().GoToUrl(ConfigurationManager.AppSettings["RapidApplicationUrl"]); System.Threading.Thread.Sleep(5000); ClickElement(ManageObjects.LoginPage.UserName_EditBox(driver)); EnterTextBoxValue(ManageObjects.LoginPage.UserName_EditBox(driver), username.Trim()); System.Threading.Thread.Sleep(5000); ClickElement(ManageObjects.LoginPage.Password_EditBox(driver)); EnterTextBoxValue(ManageObjects.LoginPage.Password_EditBox(driver), password.Trim()); System.Threading.Thread.Sleep(5000); ClickElement(ManageObjects.LoginPage.Login_Button(driver)); System.Threading.Thread.Sleep(5000); isLoggedIn = IsWebElementDisplayed_And_Enabled(ManageObjects.LoginPage.RapidApplication_HomePage(driver)); } catch (Exception ex) { Console.WriteLine("LoginRapidApplication:" + ex.Message); } return(isLoggedIn); }
public void InitializeWebDriver() { Console.WriteLine("Called Before Scenario..."); defalut_Browser = ConfigurationManager.AppSettings["default_browser"]; Console.WriteLine("Selected Browser: " + defalut_Browser); solution_path = Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())); _webDriver = mDriver.SetWebDriver(defalut_Browser); if (_webDriver.WindowHandles != null) { _objectContainer.RegisterInstanceAs <IWebDriver>(_webDriver); } }