/// <summary> /// Chooses a learner in the learners table, clicks on the Actions button, clicks on Add/Remove Flag, fill in /// all of the fields with random data and clicks Save Flag /// </summary> /// <param name="learnerFullName"></param> public void AddFlag(string learnerFullName) { ElemSet.Grid_ClickMenuItemInsideButton(Browser, LearnersTbl, Bys.CBDProgDirectorPage.LearnersTblRowBody, learnerFullName, null, "Actions", "Add/Remove Flag"); Browser.WaitForElement(Bys.CBDProgDirectorPage.AddRemoveFlagFormReasonTxt, ElementCriteria.IsVisible); this.WaitUntilAll(Criteria.CBDProgDirectorPage.LoadElementClassAttributeSetToHide, Criteria.CBDProgDirectorPage.LoadElementDisappeared); AddRemoveFlagFormReasonTxt.SendKeys(DataUtils.GetRandomSentence(10)); ClickAndWait(AddRemoveFlagFormSaveFlagBtn); }
/// <summary> /// Chooses a program from the Program dropdown, clicks on the Learner tab, chooses a user specified Learner, /// clicks on the Actions button, clicks on Add/Remove Flag, fill in /// all of the fields with random data and clicks Save Flag /// </summary> /// <param name="program">The text from one of the items in the Program dropdown</param> /// <param name="learnerFullName">First and last name of the learner</param> public void AddFlag(string program, string learnerFullName) { SelectProgram(program); ClickAndWait(LearnersTab); ElemSet.Grid_ClickMenuItemInsideButton(Browser, LearnersTbl, Bys.CBDProgDeanPage.LearnersTblBodyRow, learnerFullName, null, "Actions", "Add/Remove Flag"); Browser.WaitForElement(Bys.CBDProgDeanPage.AddRemoveFlagFormReasonTxt, ElementCriteria.IsVisible); this.WaitUntil(Criteria.CBDProgDeanPage.LoadElementDoneLoading); AddRemoveFlagFormReasonTxt.SendKeys(DataUtils.GetRandomSentence(10)); ClickAndWait(AddRemoveFlagFormSaveFlagBtn); }
/// <summary> /// Chooses a learner in the learners table, clicks on the Actions button, clicks on Add/Remove Flag, fill in /// all of the fields with random data and clicks Save Flag /// </summary> /// <param name="learnerFullName"></param> public void AddFlag(string learnerFullName) { IWebElement btn = ElemSet.Grid_ClickButtonOrLinkWithinRow(Browser, LearnersTbl, Bys.CBDProgDirectorPage.LearnersTblRowBody, learnerFullName, "a", "Actions", "span"); Thread.Sleep(0500); IWebElement btnParent = XpathUtils.GetNthParentElem(btn, 3); ElemSet.Grid_ClickMenuItemInsideDropdown(Browser, btnParent, "Add/Remove Flag"); Browser.WaitForElement(Bys.CBDProgDirectorPage.AddRemoveFlagFormReasonTxt, ElementCriteria.IsVisible); this.WaitUntilAll(Criteria.CBDProgDirectorPage.LoadElementClassAttributeSetToHide, Criteria.CBDProgDirectorPage.LoadElementDisappeared); AddRemoveFlagFormReasonTxt.SendKeys(DataUtils.GetRandomSentence(10)); ClickAndWait(AddRemoveFlagFormSaveFlagBtn); }
/// <summary> /// Chooses a program from the Program dropdown, clicks on the Learner tab, chooses a user specified Learner, /// clicks on the Actions button, clicks on Add/Remove Flag, fill in /// all of the fields with random data and clicks Save Flag /// </summary> /// <param name="program">The text from one of the items in the Program dropdown</param> /// <param name="learnerFullName">First and last name of the learner</param> public void AddFlag(string program, string learnerFullName) { SelectProgram(program); ClickAndWait(LearnersTab); IWebElement btn = ElemSet.Grid_ClickButtonOrLinkWithinRow(Browser, LearnersTbl, Bys.CBDProgDeanPage.LearnersTblBodyRow, learnerFullName, "a", "Actions", "span"); Thread.Sleep(0500); IWebElement btnParent = XpathUtils.GetNthParentElem(btn, 3); ElemSet.Grid_ClickMenuItemInsideDropdown(Browser, btnParent, "Add/Remove Flag"); Browser.WaitForElement(Bys.CBDProgDeanPage.AddRemoveFlagFormReasonTxt, ElementCriteria.IsVisible); this.WaitUntil(Criteria.CBDProgDeanPage.LoadElementDoneLoading); AddRemoveFlagFormReasonTxt.SendKeys(DataUtils.GetRandomSentence(10)); ClickAndWait(AddRemoveFlagFormSaveFlagBtn); }