Exemple #1
0
        public void ValidateApplicantSubMenu()
        {
            //Override Default BrowserType with DataSource BrowserType
            //BT = Convert.ToString(testContextInstance.DataRow["BrowserType"]);

            Driver = SetUp(BT); //Stand up Driver and Log Test
            Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString());

            var LoginData  = new Data.LoginData();
            var LogingPage = new Pages.LoginPage(Driver);
            var MainMenu   = new Pages.MainMenu(Driver);
            var AppSubMenu = new Pages.SubMenuApplicants(Driver);

            try  //Contains Contents of Test
            {
                BrowseTo(_baseURL, Driver);
                LogingPage.EnterUsername(LoginData.UserName);
                LogingPage.EnterPwd(LoginData.Password);
                LogingPage.ClickLogin();
                MainMenu.ClickApplicants();
                AppSubMenu.VerifyApplicantsSubMenu();
                Driver.Quit();
            }
            catch (Exception e) //On Error Do
            {
                OnError(e, Driver);
                throw;
            }
        }
        public void CreateNewForms()

        {
            TestSetup(BT);

            BrowseTo(_baseURL, getwebdriver());

            login(); //login into application
            //1.click on Form menu
            ClickMenuLink("Forms");
            //2.Click on design "design forms and packets"
            ClickSubMenuLink("Design Forms and Packets");

            //3.Click on "Create new from"
            ClickSubMenuLink("Create New Form");

            switchtoFramByLocator(FileOperations.getElement("Frame1_id"));
            // 4.Click on "blank form".
            Click(FileOperations.getElement("BlankFormlink_xpath"));


            switchtoFramByLocator(FileOperations.getElement("Frame2_id"));
            ////5.Fill form details:
            //• Select form type
            Click(FileOperations.getElement("StandardRadiobtn_xpath"));
            //• Enter title
            TypeText(FileOperations.getElement("FormTitle_xpath"), "testform");
            switchtoDefault();
            //• Click on "save " button
            switchtoFramByLocator(FileOperations.getElement("Frame1_id"));
            Click(FileOperations.getElement("FormSaveBtn_xpath"));

            Click(FileOperations.getElement("FormPermissionTab_xpath"));
            Click(FileOperations.getElement("FormSaveBtn_xpath"));

            Click(FileOperations.getElement("FormWorkflowTab_xpath"));

            Click(FileOperations.getElement("FormSaveBtn_xpath"));

            Click(FileOperations.getElement("FormAppearanceTab_xpath"));

            Click(FileOperations.getElement("FormSaveBtn_xpath"));

            VerifyText(FileOperations.getElement("SavedFormmsg_id"), "Form Saved");

            switchtoDefault();

            //6.Click on "Create new form"
            ClickSubMenuLink("Create New Form");
            Thread.Sleep(2000);
            switchtoFramByLocator(FileOperations.getElement("Frame1_id"));
            //7.Click on "an existing form"

            Click(FileOperations.getElement("ExistingForm_xpath"));

            //• Click on active form
            Click(FileOperations.getElement("ActiveForm_xpath"));
            //• Select first form
            Click(FileOperations.getElement("FirstExistingForm_id"));
            switchtoFramByLocator(FileOperations.getElement("Frame2_id"));
            //• Enter title name
            TypeText("//*[@id='TextboxFormTitle']", "abcd");
            switchtoFramByLocator(FileOperations.getElement("Frame1_id"));
            Click(FileOperations.getElement("FormSaveBtn_xpath"));
            Click(FileOperations.getElement("FormPermissionTab_xpath"));
            Click(FileOperations.getElement("FormSaveBtn_xpath"));

            Click(FileOperations.getElement("FormWorkflowTab_xpath"));

            Click(FileOperations.getElement("FormSaveBtn_xpath"));

            Click(FileOperations.getElement("FormAppearanceTab_xpath"));

            Click(FileOperations.getElement("FormSaveBtn_xpath"));

            VerifyText(FileOperations.getElement("SavedFormmsg_id"), "Form Saved");

            switchtoDefault();

            var Login = new Pages.LoginPage(getwebdriver());
            // Login.ClickLogOut();
        }