public void IsLogin(String user)
        {
            WindowsMessages w = new WindowsMessages();

            //Go to Desk Page
            _reportingTasks.CreateNode("User Authorization action");
            Goto(_config.PlmUrl);
            SeleniumGetMethod.WaitForPageLoad(driver);
            //If User not login
            if (driver.Url.IndexOf("plmOn/Desk/", StringComparison.OrdinalIgnoreCase) == -1)
            {
                SeleniumGetMethod.WaitForPageLoad(driver);
                //Go to Login page
                driver.Navigate().GoToUrl(_config.PlmUrlDef);
                var pagelogin = _pages.GetPage <LoginPageObjects>();
                pagelogin.Login(user, _config.Password);

                _reportingTasks.Log(Status.Info, user + " Login in the system");
                SeleniumGetMethod.WaitForPageLoad(driver);
            }
            else
            {
                if (browserName == "Edge")
                {
                    driver.ExecuteJavaScript(@"window.onbeforeunload = function(){}");
                }
            }
        }
예제 #2
0
        public void IsLogin(String user)
        {
            // go to Sign In Page
            _reportingTasks.CreateNode("User Authorization action");
            Goto(_config.PlmUrl);
            SeleniumGetMethod.WaitForPageLoad(driver);
            var pagelogin = _pages.GetPage <LoginPageObjects>();

            pagelogin.Login(user, _config.Password);
            SeleniumGetMethod.WaitForPageLoad(driver);
            // in case of failed login
            if (driver.Url.IndexOf("ModuleItems", StringComparison.OrdinalIgnoreCase) == -1)
            {
                SeleniumGetMethod.WaitForPageLoad(driver);
                // go to Login page
                driver.Navigate().GoToUrl(_config.PlmUrlDef);
                var logPage = _pages.GetPage <LoginPageObjects>();
                pagelogin.Login(user, _config.Password);
                _reportingTasks.Log(Status.Info, user + " Login in the system once again");
                SeleniumGetMethod.WaitForPageLoad(driver);
            }
        }