public void DeleteQuestion(string ConfigKey, string SheetName)
        {
            BaseMethods.InfoLogger("Deleting added Questions from User Details Form");
            ArrayList list  = ExcelData.GetData(ConfigKey, SheetName, "Execute", "Yes");
            int       count = list.Count;

            count = count / 2;
            int j = 1;

            if (list[j].ToString() != "EnterQuestionName")
            {
                for (int i = 0; i < count; i++)
                {
                    try
                    {
                        string      _QueText = driver.FindElement(By.XPath("//strong[contains(text(),'" + list[j].ToString() + "')]/../strong")).Text;
                        IWebElement ele      = driver.FindElement(By.XPath("//strong[contains(text(),'" + list[j].ToString() + "')]/../../div[4]/span[2]/a"));
                        ele.Click();
                        Delete();
                        string DeleteExpectedSucessMsg = "×\r\n>   The form question '" + _QueText + "' was deleted successfully.   ";
                        string DeleteActualSucessMsg   = GetAlertMessage();
                        Assert.AreEqual(DeleteExpectedSucessMsg, DeleteActualSucessMsg);
                        ExcelData.UpdateData("UserDetailsFormData", "DeleteQuestions", "SearchQuestion", "EnterQuestionName", "SearchQuestion", list[j].ToString());
                    }
                    catch (NoSuchElementException)
                    {
                        ExtentReport.test.Log(LogStatus.Warning, list[j].ToString() + " : Question not found");
                    }
                }
            }
        }
        public void CreateMultipleSteps(IWebDriver _driver, string ConfigKey, string Sheet, string ConditionKey)
        {
            ArrayList list = null;

            if (ConfigKey == "PositionDetailsFormData")
            {
                list = ExcelData.GetData(ConfigKey, Sheet, ConditionKey, "Yes");
            }
            else
            {
                list = ExcelData.GetData(ConfigKey, Sheet, ConditionKey, _FormType);
            }
            if (list != null)
            {
                int _Count          = list.Count;
                int _actualRowCount = _Count / 4;
                int j = 1;
                for (int i = 1; i <= _actualRowCount; i++)
                {
                    AddNewFormStep();
                    StepTitle(list[j].ToString());
                    BaseMethods.TinyMCEEditor(_driver, StepDescription(), list[j + 1].ToString());
                    BaseMethods.PageScrollDown(_driver);
                    QuestionLabelWidth(_driver, list[j + 2].ToString());
                    SaveStepDetails();
                    BaseMethods.InfoLogger("Step has been added successfully");
                    j = j + 4;
                }
            }
        }
        /// <summary>
        /// Select Role Permissions
        /// </summary>
        /// <param name="_driver">IWebDriver</param>
        public void SelectRolePermissions(IWebDriver _driver, string ConfigKey, string SheetName, string ConditionKey, string Condition)
        {
            ArrayList list = ExcelData.GetData(ConfigKey, SheetName, ConditionKey, Condition);

            RolePermissions();
            BaseMethods.InfoLogger("Selecting Role Permissions");
            string[] ValueList = list[1].ToString().Split(',');
            if (list != null)
            {
                IList <IWebElement> _list = eleChkRoleID;
                for (int j = 0; j < ValueList.Length; j++)
                {
                    for (int i = 0; i < _list.Count; i++)
                    {
                        IWebElement ele   = _driver.FindElement(By.XPath("(//input[@name='RoleID'])[" + (i + 1) + "]/../label"));
                        string      value = ele.Text;
                        if (ValueList[j].ToString() == value)
                        {
                            _list[i].Click();
                            BaseMethods.InfoLogger(value + " is Selected");
                            break;
                        }
                    }
                }
                Save();
                string RolePermissionsExpectedResult = "×\r\n>   Role permissions updated.   ";
                string RolePermissionsActualResult   = DivAlertMsg();
                Assert.AreEqual(RolePermissionsExpectedResult, RolePermissionsActualResult);
            }
        }
示例#4
0
        public void DeleteGQ_NotInUse()
        {
            HomePage homePage = new HomePage(_driver);
            SelectQuestionTypePage selectQuestionTypePage = new SelectQuestionTypePage(_driver);

            ExtentReport.test = ExtentReport.extent.StartTest("To Delete Global Question that are not in use");
            ArrayList list = ExcelData.GetData("ER_TESTDATA", "HomePagesVerify", "KeyName", "HomeSystemConfigurationPage");

            homePage.EperformSystemConfigurationArrowIcon.Click();
            homePage.EperformGlobalQuestionsOption.Click();
            Assert.IsTrue(selectQuestionTypePage.BtnAddGlobalQuestion.Displayed, "Add Global Questions Button is not displayed in the Global Question List Page");
            ExtentReport.test.Log(LogStatus.Pass, "Add Global Questions Button is displayed in the Global Question List Page");

            DataTable dt        = ExcelData.GetData_DataTable("ER_TESTDATA", "GQSingleLineTextBox", "KeyName", "Default");
            string    reference = selectQuestionTypePage.CreateGQ_SingleLineTextBox(dt.Rows[0]);

            GlobalQuestionsListPage gqListPage = new GlobalQuestionsListPage(_driver);

            gqListPage.SearchGQ(reference);
            Thread.Sleep(2000);
            gqListPage.SearchedDeleteButton.Click();
            Thread.Sleep(2000);
            gqListPage.DeletePopupConfirmButton.Click();
            Thread.Sleep(1000);
            Assert.IsTrue(gqListPage.SuccessMessage.Displayed, reference + " - Single Line Text Box Global Question is not deleted successfully");
            ExtentReport.test.Log(LogStatus.Pass, "Success Message is displayed, " + reference + " - Single Line Text Box Global Question has been deleted successfully");
        }
示例#5
0
        public void VerifyManageGQForm_SingleLineTextBox()
        {
            HomePage homePage = new HomePage(_driver);
            SelectQuestionTypePage selectQuestionTypePage = new SelectQuestionTypePage(_driver);

            ExtentReport.test = ExtentReport.extent.StartTest("Verify Question Type Form Page");
            ArrayList list = ExcelData.GetData("ER_TESTDATA", "HomePagesVerify", "KeyName", "HomeSystemConfigurationPage");

            homePage.EperformSystemConfigurationArrowIcon.Click();
            homePage.EperformGlobalQuestionsOption.Click();
            Assert.IsTrue(selectQuestionTypePage.BtnAddGlobalQuestion.Displayed, "Add Global Questions Button is not displayed in the Global Question List Page");
            ExtentReport.test.Log(LogStatus.Pass, "Add Global Questions Button is displayed in the Global Question List Page");
            Thread.Sleep(2000);
            selectQuestionTypePage.BtnAddGlobalQuestion.Click();

            selectQuestionTypePage.RdoSingleLineTextBox.Click();
            selectQuestionTypePage.BtnSubmit.Click();

            ManageGlobalQuestionPage mGQPage = new ManageGlobalQuestionPage(_driver);

            Thread.Sleep(2000);
            Assert.IsTrue(mGQPage.PageTitle.Displayed, "Manage Global Question Page Title is not displayed in Manage Global Question page");
            ExtentReport.test.Log(LogStatus.Pass, "Manage Global Question Page Title is displayed in Manage Global Question page");

            Assert.IsTrue(mGQPage.ManageGQFormTitle_SingleLineTextBox.Displayed, "Manage Global Question - Single Line Text Box form Title is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "Manage Global Question - Single Line Text Box form Title is displayed in Manage Global Question form");

            Assert.IsTrue(mGQPage.LblMandatoryField.Displayed, "Mandatory Message text is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "Mandatory Message text is displayed in Manage Global Question form");

            Assert.IsTrue(mGQPage.LblComponentType.Displayed, "Component Type text is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "Component Type text is displayed in Manage Global Question form");

            Assert.IsTrue(mGQPage.LblSingleLineTextBox.Displayed, "Single Line Text Box text is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "Single Line Text Box text is displayed in Manage Global Question form");

            Assert.IsTrue(mGQPage.LblReference.Displayed, "Reference text is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "Reference text is displayed in Manage Global Question form");

            Assert.IsTrue(mGQPage.LblActive.Displayed, "Active text is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "Active text is displayed in Manage Global Question form");

            Assert.IsTrue(mGQPage.LblLabel.Displayed, "'Label' text is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "'Label' text is displayed in Manage Global Question form");

            Assert.IsTrue(mGQPage.LblRequired.Displayed, "Required text is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "Required text is displayed in Manage Global Question form");

            Assert.IsTrue(mGQPage.LblMaximumLength.Displayed, "Maximum Length text is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "Maximum Length text is displayed in Manage Global Question form");

            Assert.IsTrue(mGQPage.LblMaximumLengthType.Displayed, "Maximum Length Type text is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "Maximum Length Type text is displayed in Manage Global Question form");

            Assert.IsTrue(mGQPage.BtnSubmit.Displayed, "Submit button is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "Submit button is displayed in Manage Global Question form");

            Assert.IsTrue(mGQPage.BtnCancel.Displayed, "Cancel button is not displayed in Manage Global Question form");
            ExtentReport.test.Log(LogStatus.Pass, "Cancel button is displayed in Manage Global Question form");
        }
示例#6
0
        public void CreateRequisitionProcessTemplate(string ConfigKey, string SheetName, string CondKey, string CondValue)
        {
            ArrayList list = ExcelData.GetData(ConfigKey, SheetName, CondKey, CondValue);

            if (list != null && list.Count > 0)
            {
                LinkCreateRequisitionProcessTemplate();
                int Count = list.Count;
                Count = Count / 5;
                int j = 1;
                for (int i = 0; i < Count; i++)
                {
                    TxtProcessName(list[j].ToString());
                    BaseMethods.DdlSelectByText(eleDdlProcessJobId, list[(j + 1)].ToString());
                    BaseMethods.SelectCheckBox(eleChkProcessIsActive, list[(j + 2)].ToString(), "Is Active");
                    Save();
                    string ExpectedValue = "×\r\n>   Active process must have at least one step and rule.    >   Process configuration incomplete, process set to inactive.   ";
                    string ActualValue   = DivAlertMsg();
                    Assert.AreEqual(ExpectedValue, ActualValue);
                    CreateStep(list[(j + 3)].ToString());
                    CreateRule();
                    BaseMethods.SelectCheckBox(eleChkProcessIsActive, "Yes", "Is Active");
                    Save();
                }
            }
        }
示例#7
0
        public void DeleteRequisitionProcess(IWebDriver _driver)
        {
            ArrayList Deletelist = ExcelData.GetData("RequisitionProcessTemplateData", "Delete_RequisitionProcess");

            if (Deletelist != null && Deletelist.Count > 0)
            {
                BaseMethods.DdlSelectByText(eleDdlProcessIsActive, "All");
                for (int i = 0; i < Deletelist.Count; i++)
                {
                    string _DelName = Deletelist[i].ToString();
                    try
                    {
                        IWebElement ele = driver.FindElement(By.XPath("(//a[text()='" + _DelName + "'])[1]"));
                        ele.Click();
                    }
                    catch (NoSuchElementException)
                    {
                        BaseMethods.InfoLogger("Record not found to Delete");
                    }
                    BaseMethods.ExplicitWait(_driver, "//div[@id='productFeedbackPromptDialog']/p/a");
                    elePopUpNoThanks.Click();
                    LinkDeleteProcess();
                    Delete();
                    string PermissionsExpectedMsg = "×\r\n>   The Requisition Process Template " + _DelName + " has been deleted.   ";
                    string PermissionsActualMsg   = DivAlertMsg();
                    Assert.AreEqual(PermissionsExpectedMsg, PermissionsActualMsg);
                    BaseMethods.InfoLogger("The Requisition Process Template " + _DelName + " has been deleted");
                }
            }
        }
示例#8
0
        public void CreateNewRequisition(IWebDriver _driver)
        {
            ArrayList ReqList = ExcelData.GetData("RequisitionData", "Requisition");

            LinkCreateNewRequisition();
            RadioCreateNewReq(ReqList[0].ToString());
            if (ReqList[0].ToString() == "Raise an ATR for a new position")
            {
                try
                {
                    IWebElement ele = driver.FindElement(By.XPath("//td[contains(text(),'" + ReqList[1].ToString() + "')]/../td[5]/a"));
                    ele.Click();
                }
                catch (Exception)
                {
                    ExtentReport.test.Log(LogStatus.Error, "Requisition Process Template was not found in the list");
                }
                BaseMethods.ExplicitWait(_driver, "//a[text()='View / Add Recruiter Files']");
                foreach (IWebElement ele in eleTxtAnswers)
                {
                    ele.SendKeys("Answer Entered");
                }
                SaveAndContinue();
                foreach (IWebElement ele in eleTxtAnswers)
                {
                    ele.SendKeys("Answer Entered");
                }
                PreviewAndSubmit();
                SaveAndSubmit();
            }
        }
        /// <summary>
        /// Select Default Talent Search Template
        /// </summary>
        public void DefaultTalentSearchTemplate(string ConfigKey, string SheetName, string ConditionKey, string Condition, string TestType)
        {
            ArrayList list = ExcelData.GetData(ConfigKey, SheetName, ConditionKey, Condition);

            SetDefaultTalentSearchTemplate();
            BaseMethods.InfoLogger("Selecting Set Default Talent Search Template");
            if (list != null)
            {
                BaseMethods.DdlSelectByText(eleDdlTalentSearchID, list[1].ToString());
                BaseMethods.InfoLogger(list[1].ToString() + " is Selected as Default Talent Search Template");
            }
            Save();
            if (TestType == "UserGroup")
            {
                string DTSTExpectedResult          = "×\r\n>   Default user group talent search template has been saved.   ";
                string DTSTPermissionsActualResult = DivAlertMsg();
                Assert.AreEqual(DTSTExpectedResult, DTSTPermissionsActualResult);
            }
            else
            {
                string DTSTExpectedResult          = "×\r\n>   Default user talent search template has been saved.   ";
                string DTSTPermissionsActualResult = DivAlertMsg();
                Assert.AreEqual(DTSTExpectedResult, DTSTPermissionsActualResult);
            }
            LinkManageUserGroup();
        }
        public void EditQuestion(string ConfigKey, string SheetName)
        {
            BaseMethods.InfoLogger("Editing added Questions from User Details Form");
            ArrayList list  = ExcelData.GetData(ConfigKey, SheetName, "Execute", "Yes");
            int       count = list.Count;

            count = count / 2;
            int j = 1;

            if (list[j].ToString() != "EnterQuestionName")
            {
                for (int i = 0; i < count; i++)
                {
                    try
                    {
                        IWebElement ele = driver.FindElement(By.XPath("//strong[contains(text(),'" + list[j].ToString() + "')]/../../div[4]/span[1]/a"));
                        ele.Click();
                        BaseMethods.TinyMCEEditor(driver, eleIfameQue, "Editing Functionality Testing");
                        Save();
                        string EditExpectedSucessMsg = "×\r\n>   Question saved successfully.   ";
                        string EditActualSucessMsg   = GetAlertMessage();
                        Assert.AreEqual(EditExpectedSucessMsg, EditActualSucessMsg);
                        ExcelData.UpdateData("UserDetailsFormData", "EditQuestions", "EditQuestionName", "EnterQuestionName", "EditQuestionName", list[j].ToString());
                    }
                    catch (NoSuchElementException)
                    {
                        ExtentReport.test.Log(LogStatus.Warning, list[j].ToString() + " : Question not found");
                    }
                    BaseMethods.Navigate_Back(driver);
                    BaseMethods.Navigate_Back(driver);
                }
            }
        }
        public void AddQuestion(IWebDriver _driver, int EleValue, string Key, string Sheet, string StepNum)
        {
            _05_FormTemplateCreationPage FormTempCreaPage = new _05_FormTemplateCreationPage(_driver);
            ArrayList SingleRowData = null;

            if (Key == "UserDetailsFormData")
            {
                SingleRowData = ExcelData.GetData(Key, Sheet, "Execute", "Yes");
            }
            else
            {
                SingleRowData = ExcelData.GetData(Key, Sheet, "StepNumber", StepNum);
            }
            int Count = SingleRowData.Count;

            Count = Count / 8;
            int j = 1;

            BaseMethods.PageScrollDown(_driver);
            for (int i = 1; i <= Count; i++)
            {
                IList <IWebElement> elements = FormTempCreaPage.QuestionEleList(_driver);
                elements[EleValue].Click();
                BaseMethods.InfoLogger("Add Question To Step Started");
                if (Key == "RequisitionProcessTemplateData")
                {
                    ReferenceText(SingleRowData[j].ToString(), false);
                }
                else
                {
                    ReferenceText(SingleRowData[j].ToString(), true);
                }
                BaseMethods.DdlSelectByText(eleddlQuestionType, SingleRowData[j + 1].ToString());
                BaseMethods.InfoLogger("Question Type is: " + SingleRowData[j + 1].ToString());
                BaseMethods.SleepTimeOut(1000);
                BaseMethods.DdlSelectByText(eleddlAnswerformat, SingleRowData[j + 2].ToString());
                BaseMethods.InfoLogger("Answer Format is: " + SingleRowData[j + 2].ToString());
                BaseMethods.SleepTimeOut(1000);
                BaseMethods.DdlSelectByText(eleddldatatype, SingleRowData[j + 3].ToString());
                BaseMethods.InfoLogger("Data Type is: " + SingleRowData[j + 3].ToString());

                if (SingleRowData[j + 1].ToString() == "Free Text")
                {
                    EnterMaxLength(SingleRowData[j + 4].ToString());
                    BaseMethods.DdlSelectByText(eleddlMaxLengthType, SingleRowData[j + 5].ToString());
                    BaseMethods.InfoLogger("Max Length is: " + SingleRowData[j + 5].ToString());
                }
                BaseMethods.TinyMCEEditor(_driver, eletxtQuestion, SingleRowData[j + 6].ToString());
                Save();
                string ExpectedMsg = "×\r\n>   Question saved successfully.   ";
                string ActualMsg   = GetAlertMessage();
                BaseMethods.SoftAssertEqual(ExpectedMsg, ActualMsg);

                BaseMethods.Navigate_Back(_driver);
                BaseMethods.Navigate_Back(_driver);
                j += 8;
            }
        }
        /// <summary>
        /// Get Form Details From Excel
        /// </summary>
        /// <param name="FormName">Form Name</param>
        /// <returns>Array List</returns>
        public ArrayList GetFormDetails(string ConfigKey, string Sheet, string ConditionKey, string FormName)
        {
            ArrayList list = ExcelData.GetData(ConfigKey, Sheet, ConditionKey, FormName);

            _FormType   = list[0].ToString();
            _FormName   = list[1].ToString();
            _FormStatus = list[2].ToString();
            return(list);
        }
        public void CreateNewChildQuestion(IWebDriver _driver)
        {
            ArrayList list            = ExcelData.GetData("GlobalQuestionsData", "GQwithChildQuestions", "Execute", "Yes");
            int       Count           = list.Count;
            int       _actualRowCount = Count / 12;
            int       j = 1;

            for (int i = 0; i < _actualRowCount; i++)
            {
                BaseMethods.InfoLogger("Creating Child Question Started");
                // Click on Add New Child Question Link
                LinkAddNewChildQuestion();
                //  Fill the Fileds
                QuestionReference(list[j].ToString());

                BaseMethods.TinyMCEEditor(_driver, GlobalComponentLabel(), list[(j + 1)].ToString());

                BaseMethods.DdlSelectByText(ComponentType(), list[(j + 2)].ToString());
                BaseMethods.InfoLogger("Question Type: " + list[(j + 2)].ToString());

                BaseMethods.DdlSelectByText(AnswerDisplayFormat(), list[(j + 3)].ToString());
                BaseMethods.InfoLogger("Answer Display Format: " + list[(j + 3)].ToString());

                BaseMethods.DdlSelectByText(DataType(), list[(j + 4)].ToString());
                BaseMethods.InfoLogger("Data Type: " + list[(j + 4)].ToString());

                if (list[6].ToString() != "Null")
                {
                    AnswerConfiguration(list[(j + 5)].ToString());
                }

                BaseMethods.NoYesRadioButtons(_driver, ChildIsRequired(), list[(j + 6)].ToString());
                BaseMethods.InfoLogger("Is Required: " + list[(j + 6)].ToString());

                BaseMethods.NoYesRadioButtons(_driver, IsHidden(), list[(j + 7)].ToString());
                BaseMethods.InfoLogger("Is Hidden: " + list[(j + 7)].ToString());

                if (list[(j + 8)].ToString() != "Null")
                {
                    MaxLength(list[(j + 8)].ToString());
                }

                if (ValidationType().Displayed)
                {
                    BaseMethods.DdlSelectByText(ValidationType(), list[(j + 9)].ToString());
                    BaseMethods.InfoLogger("Validation Type: " + list[(j + 9)].ToString());
                }
                GlobalComponentXMLName(list[(j + 10)].ToString());
                ChildSave();
                string ExpectedSucessMsg = "×\r\n>   Child Question configuration updated successfully.   ";
                string ActualSucessMsg   = GetAlertMessage();
                Assert.AreEqual(ExpectedSucessMsg, ActualSucessMsg);
                LinkGlobalQuestion();
                j = j + 12;
            }
        }
        /// <summary>
        /// Create Global Questions
        /// </summary>
        /// <param name="_driver">IWebDriver</param>
        public void CreateQuestions(IWebDriver _driver, string Key, string Sheet, string ConditionValue, string Value)
        {
            _04_GlobalQtnListPage GQP  = new _04_GlobalQtnListPage(_driver);
            ArrayList             list = ExcelData.GetData(Key, Sheet, ConditionValue, Value);
            int Count           = list.Count;
            int _actualRowCount = Count / 8;
            int j = 1;

            for (int i = 0; i < _actualRowCount; i++)
            {
                BaseMethods.InfoLogger("Creating Global 0" + (i + 1) + " Question Started");
                QuestionDetails();
                BaseMethods.DdlSelectByText(eleddlQuestionType, list[j].ToString());
                BaseMethods.InfoLogger("Question Type: " + list[(j)].ToString());
                string[] formTypesList = list[(j + 1)].ToString().Split(',');
                BaseMethods.CtrlKeyDown(_driver);
                for (int k = 0; k < formTypesList.Length; k++)
                {
                    BaseMethods.DdlSelectByText(eleddlFormType, formTypesList[k]);
                    BaseMethods.InfoLogger("Question Use: " + formTypesList[k].ToString());
                }
                if (list[(j + 2)].ToString() == "Yes")
                {
                    IsActiveYes();
                }
                else
                {
                    IsActiveNo();
                }
                ReferenceText(list[(j + 3)].ToString(), true);
                ShortQuestionText(list[(j + 4)].ToString());
                BaseMethods.TinyMCEEditor(_driver, eleFrame, list[(j + 5)].ToString());
                Save();
                string ExpectedSucessMsg = "×\r\n>   Global Question configuration updated successfully.   ";
                string ActualSucessMsg   = GetAlertMessage();
                BaseMethods.SoftAssertEqual(ExpectedSucessMsg, ActualSucessMsg);
                if (list[j].ToString() == "Group Question")
                {
                    CreateGlobalQueWithOptionsPage ChildQue = new CreateGlobalQueWithOptionsPage(_driver);
                    // Click on Answer Options Tab
                    AnswerOptions();
                    ChildQue.CreateNewChildQuestion(_driver);
                }
                if (list[j].ToString() == "Group Question" || list[j].ToString() == "Multi Select")
                {
                    // Click on Answer Options Tab
                    AnswerOptions();
                    AddNewAnswers(_driver, list[(j + 6)].ToString());
                }
                j = j + 8;
                GlobalQuestionLink();
                GQP.CreateNewGlbQtn();
            }
        }
        public void AddGlobalQuestion(IWebDriver _driver, int EleValue, string Key, string Sheet, string StepNum)
        {
            _05_FormTemplateCreationPage FormTempCreaPage = new _05_FormTemplateCreationPage(_driver);
            ArrayList SingleRowData = null;

            if (Key == "UserDetailsFormData")
            {
                SingleRowData = ExcelData.GetData(Key, Sheet, "Execute", "Yes");
            }
            else
            {
                SingleRowData = ExcelData.GetData(Key, Sheet, "StepNumber", StepNum);
            }
            int Count = SingleRowData.Count;

            Count = Count / 3;
            int j = 1;

            BaseMethods.PageScrollDown(_driver);
            for (int i = 1; i <= Count; i++)
            {
                BaseMethods.SleepTimeOut(3000);
                IList <IWebElement> elements = FormTempCreaPage.GlobalQuestionEleList(_driver);
                if (i == 1)
                {
                    BaseMethods.PartialPageScrollDown(_driver);
                }
                else
                {
                    BaseMethods.PageScrollDown(_driver);
                }
                BaseMethods.ScrollToView(_driver, elements[EleValue]);
                elements[EleValue].Click();
                BaseMethods.SleepTimeOut(2000);
                BaseMethods.InfoLogger("Add Global Question To Step Started");
                SearchKeyword(SingleRowData[j].ToString());
                Search();
                BaseMethods.PageScrollDown(_driver);
                IWebElement ele = GlobalQueElement(_driver, SingleRowData[j + 1].ToString());
                if (ele != null)
                {
                    ele.Click();
                    BaseMethods.InfoLogger("Selecting the Global Question");
                    AddGlobalQuestion();
                    BaseMethods.SleepTimeOut(3000);
                }
                else
                {
                    BaseMethods.InfoLogger("No results found. Global Question is not added");
                    Cancel();
                }
                j += 3;
            }
        }
示例#16
0
        public void CreatePermissions(string _KeyValue)
        {
            ArrayList Permissionslist = ExcelData.GetData("RequisitionProcessTemplateData", "CreateStep_Permissions", "StepTypeKey", _KeyValue);

            if (Permissionslist != null && Permissionslist.Count > 0)
            {
                PermissionsTab();
                RadioPermissions(Permissionslist[1].ToString());
                if (Permissionslist[1].ToString() == "Configure Now")
                {
                    AssessmentUsers(driver, Permissionslist);
                    BaseMethods.SelectCheckBox(eleChkSendTaskNotificationEmail, Permissionslist[10].ToString(), "Send Task Notification Email");
                    if (Permissionslist[10].ToString() == "Yes" && eleChkSendTaskNotificationEmail.Selected)
                    {
                        BaseMethods.DdlSelectByText(eleDdlEmailID, Permissionslist[11].ToString());
                    }
                }
                else if (Permissionslist[1].ToString() == "Configure immediately prior to step opening")
                {
                    AssessmentUsers(driver, Permissionslist, "SetupTaskUsers");
                    BaseMethods.SelectCheckBox(eleChkSendSetupTaskEmailNotification, Permissionslist[6].ToString(), "Send Setup Task Email Notification");
                    BaseMethods.DdlSelectByText(eleDdlSendSetupTaskEmailNotification, Permissionslist[7].ToString());
                    RadioDisplayUsergroupUsers(Permissionslist[8].ToString());
                    if (Permissionslist[8].ToString() == "Filter By Usergroup")
                    {
                        BaseMethods.DdlSelectByText(eleDdlFilterByGroup, Permissionslist[9].ToString());
                    }
                    BaseMethods.SelectCheckBox(eleChkSendTaskNotificationEmail, Permissionslist[10].ToString(), "Send Task Notification Email");
                    if (Permissionslist[10].ToString() == "Yes" && eleChkSendTaskNotificationEmail.Selected)
                    {
                        BaseMethods.DdlSelectByText(eleDdlEmailID, Permissionslist[11].ToString());
                    }
                }
                else if (Permissionslist[1].ToString() == "Assign to Creator")
                {
                    BaseMethods.SelectCheckBox(eleChkSendTaskNotificationEmail, Permissionslist[10].ToString(), "Send Task Notification Email");
                    if (Permissionslist[10].ToString() == "Yes" && eleChkSendTaskNotificationEmail.Selected)
                    {
                        BaseMethods.DdlSelectByText(eleDdlEmailID, Permissionslist[11].ToString());
                    }
                }
                else
                {
                    ExtentReport.test.Log(LogStatus.Error, "Invalid Data..Please check the Data provided in the 'CreateStep_Permissions' sheet.");
                }
                Save();
                string PermissionsExpectedMsg = "×\r\n>   Process Step configuration updated.   ";
                string PermissionsActualMsg   = DivAlertMsg();
                Assert.AreEqual(PermissionsExpectedMsg, PermissionsActualMsg);
                LinkRequisitionProcessTemplate();
            }
        }
        /// <summary>
        /// Select List Defaults
        /// </summary>
        public void SetListDefaultsTaskList(string ConfigKey, string SheetName, string ConditionKey, string Condition)
        {
            ArrayList list = ExcelData.GetData(ConfigKey, SheetName, ConditionKey, Condition);

            SetListDefaults();
            BaseMethods.InfoLogger("Selecting Set List Defaults");
            if (list != null)
            {
                BaseMethods.DdlSelectByText(eleDdlTalentSearchID, list[1].ToString());
                BaseMethods.InfoLogger(list[1].ToString() + " is Selected as Set List sDefaults");
            }
            Save();
        }
示例#18
0
        public void VerifyQuestionTypeForm()
        {
            HomePage homePage = new HomePage(_driver);
            SelectQuestionTypePage selectQuestionTypePage = new SelectQuestionTypePage(_driver);

            ExtentReport.test = ExtentReport.extent.StartTest("Verify Question Type Form Page");
            ArrayList list = ExcelData.GetData("ER_TESTDATA", "HomePagesVerify", "KeyName", "HomeSystemConfigurationPage");

            homePage.EperformSystemConfigurationArrowIcon.Click();
            homePage.EperformGlobalQuestionsOption.Click();
            Assert.IsTrue(selectQuestionTypePage.BtnAddGlobalQuestion.Displayed, "Add Global Questions Button is not displayed in the Global Question List Page");
            ExtentReport.test.Log(LogStatus.Pass, "Add Global Questions Button is displayed in the Global Question List Page");
            Thread.Sleep(2000);
            selectQuestionTypePage.BtnAddGlobalQuestion.Click();

            Assert.IsTrue(selectQuestionTypePage.PageTitle.Displayed, "Select Question Type Page Title is not displayed in Question Component Type page");
            ExtentReport.test.Log(LogStatus.Pass, "'" + selectQuestionTypePage.PageTitle.Text + "' Page Title is displayed in Question Component Type page");

            Assert.IsTrue(selectQuestionTypePage.SelectQuestionTypeFormTitle.Displayed, "Select Question Component Type form Title is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "'" + selectQuestionTypePage.SelectQuestionTypeFormTitle.Text + "' Question Type form name is displayed in Question Type form");

            Assert.IsTrue(selectQuestionTypePage.RdoSingleLineTextBox.Displayed, "Single Line Text Box Radiobutton is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "Single Line Text Box Radiobutton is displayed in Question Component Type form");

            Assert.IsTrue(selectQuestionTypePage.RdoMultiLineTextArea.Displayed, "Multi Line Text Area Radiobutton is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "Multi Line Text Area Radiobutton is displayed in Question Component Type form");

            Assert.IsTrue(selectQuestionTypePage.RdoSelectSingleItem.Displayed, "Select Single Item from a List Radiobutton is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "Select Single Item from a List Radiobutton is displayed in Question Component Type form");

            Assert.IsTrue(selectQuestionTypePage.RdoSelectMultipleItems.Displayed, "Select Multiple Items from a List Radiobutton is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "Select Multiple Items from a List Radiobutton is displayed in Question Component Type form");

            Assert.IsTrue(selectQuestionTypePage.RdoNumeric.Displayed, "Numeric Radiobutton is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "Numeric Radiobutton is displayed in Question Component Type form");

            Assert.IsTrue(selectQuestionTypePage.RdoYesorNo.Displayed, "Yes or No Radiobutton is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "Yes or No Radiobutton is displayed in Question Component Type form");

            Assert.IsTrue(selectQuestionTypePage.RdoDate.Displayed, "Date Radiobutton is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "Date Radiobutton is displayed in Question Component Type form");

            Assert.IsTrue(selectQuestionTypePage.RdoFileUpload.Displayed, "File Upload Radiobutton is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "File Upload Radiobutton is displayed in Question Component Type form");

            Assert.IsTrue(selectQuestionTypePage.BtnSubmit.Displayed, "Submit button is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "Submit button is displayed in Question Component Type form");

            Assert.IsTrue(selectQuestionTypePage.BtnCancel.Displayed, "Cancel button is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "Cancel button is displayed in Question Component Type form");
        }
示例#19
0
        public void CreateGQ_FileUpload()
        {
            HomePage homePage = new HomePage(_driver);
            SelectQuestionTypePage selectQuestionTypePage = new SelectQuestionTypePage(_driver);

            ExtentReport.test = ExtentReport.extent.StartTest("To Create Global Question File Upload");
            ArrayList list = ExcelData.GetData("ER_TESTDATA", "HomePagesVerify", "KeyName", "HomeSystemConfigurationPage");

            homePage.EperformSystemConfigurationArrowIcon.Click();
            homePage.EperformGlobalQuestionsOption.Click();
            Assert.IsTrue(selectQuestionTypePage.BtnAddGlobalQuestion.Displayed, "Add Global Questions Button is not displayed in the Global Question List Page");
            ExtentReport.test.Log(LogStatus.Pass, "Add Global Questions Button is displayed in the Global Question List Page");

            DataTable dt = ExcelData.GetData_DataTable("ER_TESTDATA", "GQFileUpload", "KeyName", "Default");

            selectQuestionTypePage.CreateGQ_FileUpload(dt.Rows[0]);
        }
        public void CreateEmailTemplate()
        {
            ArrayList list  = ExcelData.GetData("EmailTemplatesData", "EmailTemplateCreation", "Execute", "Yes");
            int       count = list.Count;

            count = count / 9;
            int j = 1;

            for (int i = 0; i < count; i++)
            {
                BaseMethods.InfoLogger("Email Template Creation Started");
                BaseMethods.DdlSelectByText(eleDdlCreateNewEmailTemplateType, list[j].ToString());
                Go();
                BaseMethods.SleepTimeOut(3000);
                TxtTemplateName(list[(j + 1)].ToString());
                if (list[(j + 2)].ToString() != "Null")
                {
                    BaseMethods.DdlSelectByText(eleDdlReplyAddressType, list[(j + 2)].ToString());
                }
                TxtReplyTo(list[(j + 3)].ToString());
                TxtEmailSubject(list[(j + 4)].ToString());
                BaseMethods.DdlSelectByText(eleDdlEmailDisplayTemplate, list[(j + 5)].ToString());
                BaseMethods.TinyMCEEditor(driver, eleIframeEmailBody, list[(j + 6)].ToString());
                BaseMethods.PageScrollDown(driver);
                EmailAttachmentButton();
                BaseMethods.AutoItUpload(driver, list[(j + 7)].ToString());
                BaseMethods.ExplicitWait(driver, "//div[@id='uploadingListDiv']/div/a");
                SaveAndReview();
                string ExpectedValue = "×\r\n>   Email configuration updated.   ";
                string ActualValue   = DivAlertMsg();
                Assert.AreEqual(ExpectedValue, ActualValue);
                Finish();
                BaseMethods.SleepTimeOut(3000);
                IWebElement ele = driver.FindElement(By.XPath("//td[text()='" + list[(j + 1)].ToString() + "']"));
                if (ele.Displayed)
                {
                    BaseMethods.InfoLogger("Email Template Verified");
                }
                else
                {
                    ExtentReport.test.Log(LogStatus.Warning, "Email Templare could not be Verified");
                }
                j += 9;
            }
        }
示例#21
0
        public void EditGQ_SelectMultipleitems()
        {
            HomePage homePage = new HomePage(_driver);
            SelectQuestionTypePage selectQuestionTypePage = new SelectQuestionTypePage(_driver);

            ExtentReport.test = ExtentReport.extent.StartTest("To Edit Global Question Select Multiple Items from a List");
            ArrayList list = ExcelData.GetData("ER_TESTDATA", "HomePagesVerify", "KeyName", "HomeSystemConfigurationPage");

            homePage.EperformSystemConfigurationArrowIcon.Click();
            homePage.EperformGlobalQuestionsOption.Click();
            Assert.IsTrue(selectQuestionTypePage.BtnAddGlobalQuestion.Displayed, "Add Global Questions Button is not displayed in the Global Question List Page");
            ExtentReport.test.Log(LogStatus.Pass, "Add Global Questions Button is displayed in the Global Question List Page");

            DataTable dtAdd  = ExcelData.GetData_DataTable("ER_TESTDATA", "GQSelectMultipleItems", "KeyName", "Default");
            DataTable dtEdit = ExcelData.GetData_DataTable("ER_TESTDATA", "GQSelectMultipleItems", "KeyName", "Default_Edit");

            selectQuestionTypePage.EditGQ_SelectMultipleitems(dtAdd.Rows[0], dtEdit.Rows[0]);
        }
示例#22
0
        public void CreateRule()
        {
            ArrayList AddRule = ExcelData.GetData("RequisitionProcessTemplateData", "AddRule");

            if (AddRule != null && AddRule.Count > 0)
            {
                int count = AddRule.Count;
                count = count / 11;
                int j = 1;
                for (int i = 1; i <= count; i++)
                {
                    ArrayList   AddRuleList = ExcelData.GetData("RequisitionProcessTemplateData", "AddRule", "StepNumber", i.ToString());
                    IWebElement ele         = driver.FindElement(By.XPath("//form[@id='AssessmentProcessDetails']/table/tbody/tr[" + (j) + "]/td[2]/span[1]/a"));
                    ele.Click();
                    TxtRuleName(AddRuleList[1].ToString());
                    BaseMethods.DdlSelectByText(eleDdlRuleTrigger, AddRuleList[2].ToString());
                    BaseMethods.DdlSelectByText(eleDdlSource, AddRuleList[3].ToString());
                    BaseMethods.ExplicitWait(driver, "//select[@name='questionID']");
                    BaseMethods.DdlSelectByText(eleDdlQuestion, AddRuleList[4].ToString());
                    BaseMethods.SleepTimeOut(1000);
                    BaseMethods.DdlSelectByText(eleDdlApplyActionsIf, AddRuleList[5].ToString());
                    TxtApplyActions(AddRuleList[6].ToString());
                    BaseMethods.DdlSelectByText(eleDdlCriteria, AddRuleList[7].ToString());
                    Save();
                    if (AddRuleList[8].ToString() == "Yes")
                    {
                        LinkAddAction();
                        BaseMethods.DdlSelectByText(eleDdlActionType, AddRuleList[9].ToString());
                        BaseMethods.DdlSelectByText(eleDdlDecision, AddRuleList[10].ToString());
                        Save();
                        string ActionExpectedMsg = "×\r\n>   Action configuration updated.   ";
                        string ActionActualMsg   = DivAlertMsg();
                        Assert.AreEqual(ActionExpectedMsg, ActionActualMsg);
                        Save();
                        string RuleExpectedMsg = "×\r\n>   Rule configuration updated.   ";
                        string RuleActualMsg   = DivAlertMsg();
                        Assert.AreEqual(RuleExpectedMsg, RuleActualMsg);
                    }
                    Cancel();
                    j = j + 3;
                }
            }
        }
示例#23
0
        public void VerifyValidation_SelectQuestionTypePage()
        {
            HomePage homePage = new HomePage(_driver);
            SelectQuestionTypePage selectQuestionTypePage = new SelectQuestionTypePage(_driver);

            ExtentReport.test = ExtentReport.extent.StartTest("Verify Question Type Form Page");
            ArrayList list = ExcelData.GetData("ER_TESTDATA", "HomePagesVerify", "KeyName", "HomeSystemConfigurationPage");

            homePage.EperformSystemConfigurationArrowIcon.Click();
            homePage.EperformGlobalQuestionsOption.Click();
            Assert.IsTrue(selectQuestionTypePage.BtnAddGlobalQuestion.Displayed, "Add Global Questions Button is not displayed in the Global Question List Page");
            ExtentReport.test.Log(LogStatus.Pass, "Add Global Questions Button is displayed in the Global Question List Page");
            Thread.Sleep(2000);
            selectQuestionTypePage.BtnAddGlobalQuestion.Click();

            selectQuestionTypePage.BtnSubmit.Click();
            Thread.Sleep(2000);
            Assert.IsTrue(selectQuestionTypePage.ErrorMessage.Displayed, "Error Message is not displayed in Question Component Type form");
            ExtentReport.test.Log(LogStatus.Pass, "Error Message is displayed in Question Component Type form, Validation successful");
        }
        /// <summary>
        /// Delete the UserGroups
        /// </summary>
        /// <param name="ConfigKey">Configuration Key</param>
        /// <param name="SheetName">Sheet Name</param>
        public void DeleteUserGroups(string ConfigKey, string SheetName)
        {
            ArrayList list  = ExcelData.GetData(ConfigKey, SheetName, "Execute", "Yes");
            int       count = list.Count;

            count = count / 2;
            int j = 1;

            for (int i = 0; i < count; i++)
            {
                SearchToDeleteUserGruop(driver, list[j].ToString());
                DeleteUserGroup();
                ConfirmDeleteUserGroup();
                string ExpectedResult = "×\r\n>   User Group deleted.   ";
                string ActualResult   = DivAlertMsg();
                Assert.AreEqual(ExpectedResult, ActualResult);
                BaseMethods.InfoLogger(list[j].ToString() + " : User Group Delete Successfully");
                j += 2;
            }
        }
        public void CreateUserGroup(string ConfigKey, string SheetName)
        {
            ArrayList list  = ExcelData.GetData(ConfigKey, SheetName, "Execute", "Yes");
            int       count = list.Count;

            count = count / 5;
            int j = 1;

            for (int i = 1; i <= count; i++)
            {
                CreateUserGroupLink();
                UserGroupName(list[j].ToString());
                UserGroupDescription(list[(j + 1)].ToString());
                BaseMethods.DdlSelectByText(eleDdlDefaultBEEvent, list[(j + 2)].ToString());
                Save();
                string ExpectedResult = "×\r\n>   User Group configuration updated.    >   User Group members updated.   ";
                string ActualResult   = DivAlertMsg();
                Assert.AreEqual(ExpectedResult, ActualResult);
                ModulePermissions mp = new ModulePermissions(driver);
                mp.SelectModulePermissions(driver, ConfigKey, "ModulePermissions", "RowNumber", list[(j + 3)].ToString(), "UserGroup");
                FunctionPermissions FP = new FunctionPermissions(driver);
                FP.SelectFunctionPermissions(driver, ConfigKey, "FunctionPermissions", "RowNumber", list[(j + 3)].ToString(), "UserGroup");
                JobPermissions jp = new JobPermissions(driver);
                jp.AddJobPermission(driver, ConfigKey, "JobPermissions", "RowNumber", list[(j + 3)].ToString(), "UserGroup");
                RequisitionPermissions rp = new RequisitionPermissions(driver);
                rp.AddRequisitionPermissions(driver, ConfigKey, "RequisitionPermission", "RowNumber", list[(j + 3)].ToString(), "UserGroup");
                AssignUserDefinedViews Audv = new AssignUserDefinedViews(driver);
                Audv.AddAssignUserDefinedViews(ConfigKey, "AssignUDV", "RowNumber", list[(j + 3)].ToString());
                ActivityBlockPermissions abp = new ActivityBlockPermissions(driver);
                abp.SelectABIPermissions(driver, ConfigKey, "ABIPermissions", "RowNumber", list[(j + 3)].ToString(), "UserGroup");
                RolePermissions rolep = new RolePermissions(driver);
                rolep.SelectRolePermissions(driver, ConfigKey, "RolePermissions", "RowNumber", list[(j + 3)].ToString());
                JobBoardAccountPermissions jbp = new JobBoardAccountPermissions(driver);
                jbp.SelectJobBoardAccountPermissions(driver, ConfigKey, "JobBoardAccountPermissions", "RowNumber", list[(j + 3)].ToString());
                SetDefaultTalentSearchTemplate Dtst = new SetDefaultTalentSearchTemplate(driver);
                Dtst.DefaultTalentSearchTemplate(ConfigKey, "DefaultTalentSearchTemplate", "RowNumber", list[(j + 3)].ToString(), "UserGroup");
                SetListDefaults Sld = new SetListDefaults(driver);
                Sld.SetListDefaultsTaskList(ConfigKey, "SetListDefaults", "RowNumber", list[(j + 3)].ToString());
                j += 5;
            }
        }
示例#26
0
        public void ChangePassword(string ConfigKey, string SheetName)
        {
            ArrayList list  = ExcelData.GetData(ConfigKey, SheetName, "Execute", "Yes");
            int       count = list.Count;

            count = count / 5;
            int j = 1;

            for (int i = 0; i < count; i++)
            {
                BaseMethods.InfoLogger("Searching for the User:"******"//td[contains(text(),'" + list[(j + 1)].ToString() + "')]"));
                    IWebElement eleUGr     = driver.FindElement(By.XPath("//td[contains(text(),'" + list[(j + 1)].ToString() + "')]/../td[2]"));
                    string      _UserGroup = eleUGr.Text;
                    if (_UserGroup == list[(j + 2)].ToString())
                    {
                        IWebElement _edit = driver.FindElement(By.XPath("//td[contains(text(),'" + list[(j + 1)].ToString() + "')]/../td[6]/span/a"));
                        _edit.Click();
                        BaseMethods.InfoLogger("Clicked on 'Edit' link");
                        LinkChangePassword();
                        TxtNewPassword(list[(j + 3)].ToString());
                        TxtConfirmNewPassword(list[(j + 3)].ToString());
                        Save();
                        string ExpectedResult = "×\r\n>   The password was successfully updated.   ";
                        string ActualResult   = DivAlertMsg();
                        Assert.AreEqual(ExpectedResult, ActualResult);
                        LinkUserList();
                        j += 5;
                    }
                }
                catch (NoSuchElementException)
                {
                    ExtentReport.test.Log(LogStatus.Error, list[j].ToString() + ": user not Found");
                }
            }
        }
        /// <summary>
        /// Add Assign User Defined Views
        /// </summary>
        public void AddAssignUserDefinedViews(string ConfigKey, string SheetName, string ConditionKey, string Condition)
        {
            ArrayList list = ExcelData.GetData(ConfigKey, SheetName, ConditionKey, Condition);

            AssignUserDefinedViews();
            BaseMethods.InfoLogger("Selecting Assign User Defined Views");
            if (list != null)
            {
                BaseMethods.DdlSelectByText(eleDdlTalentCardUDV, list[1].ToString());
                BaseMethods.InfoLogger("Talent Card UDV: " + list[1].ToString());
                BaseMethods.DdlSelectByText(eleDdlHeaderUDV, list[2].ToString());
                BaseMethods.InfoLogger("Header UDV: " + list[2].ToString());
                BaseMethods.DdlSelectByText(eleDdlHomePageUDV, list[3].ToString());
                BaseMethods.InfoLogger("Home Page UDV: " + list[3].ToString());
            }
            Save();
            string AudvExpectedResult = "×\r\n>   Assigned User Defined Views Updated.   ";
            string AudvActualResult   = DivAlertMsg();

            Assert.AreEqual(AudvExpectedResult, AudvActualResult);
        }
        public void AddRequisitionPermissions(IWebDriver _driver, string ConfigKey, string SheetName, string ConditionKey, string Condition, string TestType)
        {
            ArrayList list = ExcelData.GetData(ConfigKey, SheetName, ConditionKey, Condition);

            RequisitionPermissions();
            BaseMethods.InfoLogger("Selecting Requisition Permissions");
            LinkAddRequisitionPermission();
            BaseMethods.DdlSelectByText(eleDdlRequisitionPermissionType, list[1].ToString());
            BaseMethods.InfoLogger(list[1].ToString() + " option is selected for Requisition Permission Type");

            if (list[1].ToString() == "Requisition")
            {
                BaseMethods.DdlSelectByText(eleDdlRequisitionProcessSelect, list[2].ToString());
                BaseMethods.InfoLogger(list[2].ToString() + " is selected as Requisition Template");
            }
            else if (list[1].ToString() == "Requisition Template")
            {
                BaseMethods.DdlSelectByText(eleDdlRequisitionProcessSelect, list[3].ToString());
                BaseMethods.InfoLogger(list[3].ToString() + " is selected as Requisition Template");
            }
            else
            {
                Logger.log.Info("Invalid Option Selected");
                ExtentReport.test.Log(LogStatus.Error, "Invalid Option is Provided");
            }
            Save();
            if (TestType == "UserGroup")
            {
                string RequisitionExpectedResult = "×\r\n>   User Group configuration updated.   ";
                string RequisitionActualResult   = DivAlertMsg();
                Assert.AreEqual(RequisitionExpectedResult, RequisitionActualResult);
            }
            else
            {
                string RequisitionExpectedResult = "×\r\n>   User configuration updated.   ";
                string RequisitionActualResult   = DivAlertMsg();
                Assert.AreEqual(RequisitionExpectedResult, RequisitionActualResult);
            }
            LinkManageUserGroup();
        }
        /// <summary>
        /// Select Job Board Account Permissions
        /// </summary>
        /// <param name="_driver">IWebDriver</param>
        public void SelectJobBoardAccountPermissions(IWebDriver _driver, string ConfigKey, string SheetName, string ConditionKey, string Condition)
        {
            ArrayList list = ExcelData.GetData(ConfigKey, SheetName, ConditionKey, Condition);

            JobBoardAccountPermissions();
            BaseMethods.InfoLogger("Selecting Job Board Account Permissions");
            string[] ValueList = list[1].ToString().Split(',');
            if (list != null)
            {
                IList <IWebElement> _list = eleChkRoleID;
                for (int j = 0; j < ValueList.Length; j++)
                {
                    for (int i = 0; i < _list.Count; i++)
                    {
                        try
                        {
                            IWebElement ele   = _driver.FindElement(By.XPath("(//input[@name='JobBoardAccountID'])[" + (i + 1) + "]/../label"));
                            string      value = ele.Text;
                            if (ValueList[j].ToString() == value)
                            {
                                _list[i].Click();
                                BaseMethods.InfoLogger(value + " is Selected");
                                break;
                            }
                        }
                        catch (NoSuchElementException ex)
                        {
                            ExtentReport.test.Log(LogStatus.Warning, "No Elements present in Job Board Account Permissions");
                            Logger.log.Info("No Elements present in Job Board Account Permissions");
                            Logger.log.Info(ex.Message);
                        }
                    }
                }
            }
            Save();
            string JBAPermissionsExpectedResult = "×\r\n>   Job board account permissions updated.   ";
            string JBAPermissionsActualResult   = DivAlertMsg();

            Assert.AreEqual(JBAPermissionsExpectedResult, JBAPermissionsActualResult);
        }
示例#30
0
        public void ImpersonateUser(string ConfigKey, string SheetName)
        {
            ArrayList list  = ExcelData.GetData(ConfigKey, SheetName, "Execute", "Yes");
            int       count = list.Count;

            count = count / 4;
            int j = 1;

            for (int i = 0; i < count; i++)
            {
                BaseMethods.InfoLogger("Searching for the User:"******"//td[contains(text(),'" + list[(j + 1)].ToString() + "')]"));
                    IWebElement eleUGr     = driver.FindElement(By.XPath("//td[contains(text(),'" + list[(j + 1)].ToString() + "')]/../td[2]"));
                    string      _UserGroup = eleUGr.Text;
                    if (_UserGroup == list[(j + 2)].ToString())
                    {
                        IWebElement _edit = driver.FindElement(By.XPath("//td[contains(text(),'" + list[(j + 1)].ToString() + "')]/../td[6]/span/a"));
                        _edit.Click();
                        BaseMethods.InfoLogger("Clicked on 'Edit' link");
                        LinkImpersonateUser();
                        driver.SwitchTo().Frame(eleIframeEmailLog);
                        driver.FindElement(By.Name("btn_Proceed")).Click();
                        driver.SwitchTo().ParentFrame();
                        driver.FindElement(By.XPath("//a[@id='lnkImpersonation']")).Click();
                        driver.SwitchTo().Frame(eleIframeEmailLog);
                        driver.FindElement(By.Name("btn_Proceed")).Click();
                        j += 5;
                    }
                }
                catch (NoSuchElementException)
                {
                    ExtentReport.test.Log(LogStatus.Error, list[j].ToString() + ": user not Found");
                }
            }
        }