Beispiel #1
0
        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);
        }