Example #1
0
        public static void VerifyAllFooterLinks(RemoteWebDriver driver)
        {
            //(new Act("All footer links should display"));
            Selenide.ScrollToElement(driver, Util.GetLocator("footerlnk_pro"));

            string[] footerlinks = { "Pro", "Web Apps", "Mobile Apps", "Products", "Business Solutions", "API & Developer Solutions", "About", "Resources & Tools", "Blog", "Community", "Contact", "Connect" };

            int leanth = footerlinks.Length;

            for (int i = 0; i < leanth; i++)
            {
                if (footerlinks[i] == "Connect")
                {
                    Selenide.WaitForElementVisible(driver, Util.GetLocator("footerlnk_pro"));
                    Selenide.Query.isElementVisible(driver, Locator.Get(LocatorType.XPath, "//li[@id='footer-top-links']/descendant::a[contains(text(),'" + footerlinks[i] + "')]"));
                }
                else
                {
                    Selenide.WaitForElementVisible(driver, Util.GetLocator("footerlnk_pro"));
                    Selenide.Query.isElementVisible(driver, Locator.Get(LocatorType.XPath, "//li[@id='footer-top-links']/descendant::a[text()='" + footerlinks[i] + "']"));
                }
            }

            //last bottom links
            string[] bottomlinks = { "wolfram.com", "Wolfram Language", "Wolfram for Education", "Wolfram Demonstrations", "Mathematica", "MathWorld" };

            int bleanth = bottomlinks.Length;

            for (int i = 0; i < bleanth; i++)
            {
                Selenide.Query.isElementVisible(driver, Locator.Get(LocatorType.XPath, "//a[text()='" + bottomlinks[i] + "']"));
            }

            test.Log(LogStatus.Pass, "Verified all footer links");
        }
Example #2
0
 public static void ValidateLifeTimeSun(RemoteWebDriver driver)
 {
     //    //Validate the lifetime of the sun
     Selenide.WaitForElementVisible(driver, Util.GetLocator("Lifetimeofsun"));
     Selenide.Query.isElementVisible(driver, Util.GetLocator("Lifetimeofsun"));
     test.Log(LogStatus.Pass, "Verified the lifetime of the sun is 9.8 billion years");
 }
Example #3
0
 public static void ValidateRadius(RemoteWebDriver driver)
 {
     //Verify that the radius of the sun is 432300 miles.
     Selenide.WaitForElementVisible(driver, Util.GetLocator("Radiussun432300"));
     Selenide.Query.isElementVisible(driver, Util.GetLocator("Radiussun432300"));
     test.Log(LogStatus.Pass, "The radius of the sun is 432300 miles displayed");
 }
Example #4
0
 public static void Logout(RemoteWebDriver driver, string username)
 {
     ////(new Act("Logoutfrom application"));
     Selenide.Wait(driver, 4, true);
     Selenide.Click(driver, Locator.Get(LocatorType.XPath, "//span[text()='" + username + "']"));
     Selenide.WaitForElementVisible(driver, Util.GetLocator("signOutLink"));
     Selenide.Click(driver, Util.GetLocator("signOutLink"));
     test.Log(LogStatus.Pass, "Log out");
 }
Example #5
0
        /// <summary>
        /// Performs login
        /// </summary>
        /// <param name="Driver">Initialized RemoteWebDriver instance</param>
        /// <param name="username">Login Username</param>
        /// <param name="password">Login Password</param>
        public static void Login(RemoteWebDriver driver, Iteration reporter, string username, string password)
        {
            reporter.Add(new Act(String.Format("Set Username {0}, Password {1} and Click Login", username, password)));
            Selenide.WaitForElementVisible(driver, Util.GetLocator("UserNamTxtBox"));
            Selenide.SetText(driver, Util.GetLocator("UserNamTxtBox"), Selenide.ControlType.Textbox, username);
            Selenide.SetText(driver, Util.GetLocator("PasswordTxtBox"), Selenide.ControlType.Textbox, password);
            Selenide.Click(driver, Util.GetLocator("LoginBtn"));
            System.Threading.Thread.Sleep(2000);
            Actions actions = new Actions(driver);

            actions.SendKeys(OpenQA.Selenium.Keys.Escape);
            //var ajaxIsComplete = (bool)(driver as IJavaScriptExecutor).ExecuteScript("return jQuery.active == 0");
            ((IJavaScriptExecutor)driver).ExecuteScript("return window.stop();");
            var ajaxIsComplete = (bool)(driver as IJavaScriptExecutor).ExecuteScript("return jQuery.active == 0");
            //Selenide.WaitForElementVisible(driver, Util.GetLocator("DashBoardOpenTickets"));
        }
Example #6
0
        public static void LoginToWolframWithInvalidCredentials(RemoteWebDriver driver, string userName, string password)
        {
            //(new Act("Enter User name"));
            Selenide.WaitForElementVisible(driver, Util.GetLocator("User_EmailTextBox"));
            Selenide.SetText(driver, Util.GetLocator("User_EmailTextBox"), Selenide.ControlType.Textbox, userName);

            //(new Act("Enter Password"));
            Selenide.SetText(driver, Util.GetLocator("User_PasswordTextBox"), Selenide.ControlType.Textbox, password);

            //(new Act("clickon sig in button"));
            Selenide.Click(driver, Util.GetLocator("Login_SiginBtn"));

            //Verify successfully logged in to application
            Selenide.WaitForElementVisible(driver, Util.GetLocator("ErrorLogin"));
            Selenide.Query.isElementVisible(driver, Util.GetLocator("ErrorLogin"));
            test.Log(LogStatus.Pass, "Error message displayed");
        }
Example #7
0
        public static void LoginToWolfram(RemoteWebDriver driver, string userName, string password)
        {
            //(new Act("Enter User name"));
            Selenide.SetText(driver, Util.GetLocator("User_EmailTextBox"), Selenide.ControlType.Textbox, userName);

            //(new Act("Enter Password"));
            Selenide.SetText(driver, Util.GetLocator("User_PasswordTextBox"), Selenide.ControlType.Textbox, password);

            //(new Act("clickon sig in button"));
            Selenide.Click(driver, Util.GetLocator("Login_SiginBtn"));

            //Verify successfully logged in to application
            //Verify that the user name is Present in the nav bar
            Selenide.WaitForElementVisible(driver, Locator.Get(LocatorType.XPath, "//span[text()='" + userName + "']"));
            Selenide.Query.isElementVisible(driver, Locator.Get(LocatorType.XPath, "//span[text()='" + userName + "']"));
            test.Log(LogStatus.Pass, "User " + userName + "Logged in successfully");
        }
Example #8
0
 /// <summary>
 /// Performs login
 /// </summary>
 /// <param name="Driver">Initialized RemoteWebDriver instance</param>
 /// <param name="username">Login Username</param>
 /// <param name="password">Login Password</param>
 public static void Login(RemoteWebDriver driver, Iteration reporter, string username, string password)
 {
     try
     {
         reporter.Add(new Act(String.Format("Set Username {0}, Password {1} and Click Login", username, password)));
         Selenide.WaitForElementNotVisible(driver, Locator.Get(LocatorType.ID, "dlg_spinner"));
         Selenide.WaitForElementVisible(driver, Util.GetLocator("UserName_txt"));
         Selenide.SetText(driver, Util.GetLocator("UserName_txt"), Selenide.ControlType.Textbox, username);
         Selenide.WaitForElementVisible(driver, Util.GetLocator("Password_txt"));
         Selenide.SetText(driver, Util.GetLocator("Password_txt"), Selenide.ControlType.Textbox, password);
         Selenide.WaitForElementVisible(driver, Util.GetLocator("Login_btn"));
         Selenide.JS.Click(driver, Util.GetLocator("Login_btn"));
         Selenide.WaitForElementNotVisible(driver, Locator.Get(LocatorType.ID, "dlg_spinner"));
         System.Threading.Thread.Sleep(5000);
     }
     catch (Exception ex)
     {
     }
 }