Esempio n. 1
0
        // Update Quick Poll Question
        public void UpdateQuickPollQuestion(string oldQuestion, string newQuestion)
        {
            Selenium.SwitchTo().DefaultContent();
            Selenium.SelectFrameById("menu");

            //Click on Edit Poll option
            Selenium.WaitForElementPresent(QuickPollDeletePollAdminElements.EditPollSubMenuOption);
            Selenium.SafeClick(QuickPollDeletePollAdminElements.EditPollSubMenuOption);
            Thread.Sleep(2000);

            Selenium.SwitchTo().DefaultContent();
            Selenium.SelectFrameById("main");

            // Edit Poll
            Selenium.WaitForElementPresent(String.Format(QuickPollAddPollAdminElements.EditPollEditLink, oldQuestion));
            Selenium.SafeClick(String.Format(QuickPollAddPollAdminElements.EditPollEditLink, oldQuestion));
            Selenium.WaitForElementPresent(QuickPollAddPollAdminElements.EditPollQuestionsTab);

            // Clear Question text box
            Selenium.Clear(QuickPollAddPollAdminElements.EditPollQuestionTextBox);

            // Update Question
            Selenium.SafeType(QuickPollAddPollAdminElements.EditPollQuestionTextBox, newQuestion);
            Selenium.WaitForElementPresent(QuickPollAddPollAdminElements.EditPollOKButton);

            // Click on OK
            Selenium.SafeClick(QuickPollAddPollAdminElements.EditPollOKButton);
            Selenium.WaitForElementPresent(String.Format(QuickPollAddPollAdminElements.EditPollEditLink, newQuestion));
        }
Esempio n. 2
0
        // Navigate to News
        public void AddNews(string subsitename, string applicationName, string NewsTitle, string NewsBody)
        {
            Expandsubsite(subsitename);
            ExpandApplication(applicationName);
            Selenium.WaitForElementPresent(NewsPageElements.MainMenuAddNewsLink);

            // Click on Add News
            Selenium.SafeClick(NewsPageElements.MainMenuAddNewsLink);

            //switch to main
            Selenium.SwitchTo().DefaultContent();
            Selenium.SelectFrameById("main");
            Selenium.WaitForElementPresent(NewsPageElements.NewsTitleTextBox);

            //Enter Title for the news
            Selenium.SafeType(NewsPageElements.NewsTitleTextBox, NewsTitle);
            Thread.Sleep(1000);
            Selenium.SafeClick(NewsPageElements.NextButton);

            //Swicthing to news article body frame and enter news content
            Selenium.SelectFrameById(NewsPageElements.NewsArticleBodyFrameID);
            Selenium.Clear(NewsPageElements.NewsArticleBody);
            Selenium.SafeType(NewsPageElements.NewsArticleBody, NewsBody);
            Thread.Sleep(2000);

            //Swicthing back to main window since we need to click on next button
            Selenium.SwitchTo().DefaultContent();
            Selenium.SelectFrameById("main");
            Selenium.SafeClick(NewsPageElements.NextButton);
            //click finish
            Selenium.SafeClick(NewsPageElements.NewsFinishButton);
        }
Esempio n. 3
0
        // Login to iD - Admin
        public void LoginToiD(string url, String userName, String password)
        {
            string subsiteName = "Home";

            Selenium.Open(url);

            Selenium.WindowMaximize();

            Selenium.WaitForElementPresent(LoginPageElements.UserNameTextBox);

            Selenium.Clear(LoginPageElements.UserNameTextBox);
            Selenium.SafeType(LoginPageElements.UserNameTextBox, userName);

            Selenium.Clear(LoginPageElements.PasswordTextBox);
            Selenium.SafeType(LoginPageElements.PasswordTextBox, password);
            ////LoginButton
            Selenium.SafeClick(LoginPageElements.AdminLoginButton);
            Thread.Sleep(10000);

            Selenium.SwitchTo().DefaultContent();
            Selenium.SelectFrameById("header");
            Selenium.WaitForElementPresent(iDWelcomePageElements.LogoutLink);

            //Thread.Sleep(5000);
        }
        // Login to iD - FrontEnd
        public void LoginToiDFrontEnd(string url, String userName, String password)
        {
            string subsiteName = "Home";

            Selenium.Open(url);
            Selenium.WindowMaximize();

            Selenium.Clear(LoginPageElements.FrontEndUsernameTextBox);
            Selenium.Clear(LoginPageElements.FrontEndPasswordTextBox);

            Selenium.SafeType(LoginPageElements.FrontEndUsernameTextBox, userName);
            Selenium.SafeType(LoginPageElements.FrontEndPasswordTextBox, password);

            Selenium.SafeClick(LoginPageElements.FrontEndLoginButton);
            Thread.Sleep(10000);

            Selenium.SwitchTo().DefaultContent();
            //webdriver.SelectFrameById("header");
            //webdriver.WaitForElementPresent(LayoutManagerElements.ManageLayout);

            Thread.Sleep(5000);
        }