/// <summary> /// initialize elements /// </summary> public void InitElements() { Dashboard = new WebElementWrapper(ByDashboard); Create = new WebElementWrapper(ByCreate); FindTest = new WebElementWrapper(ByFindTest); TestWindows = new WebElementWrapper(ByTestWindows); AssessmentAdmin = new WebElementWrapper(ByAssessmentAdmin); //hover over the assess admin menu if (this.TestConfiguration.BrowserName != BrowserType.SAFARI) { AssessmentAdmin.MoveToElement(); } }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { TestResponseSummaryPageTitle = new WebElementWrapper(ByTestResponseSummaryPageTitle); TestResponseWarningMessage = new WebElementWrapper(ByTestResponseWarningMessage); TestResponseSummaryDetailTable = new WebElementWrapper(ByTestResponseSummaryDetailTable); AnswerSummaryDivs = new WebElementWrapper(ByAnswerSummaryDiv); AnswerDivs = new WebElementWrapper(ByAnswerDiv); UnAnsweredQuestionLinks = new WebElementWrapper(ByUnAnsweredQuestionLink); AnsweredQuestionLinks = new WebElementWrapper(ByAnsweredQuestionLink); QuestionNumberSpans = new WebElementWrapper(ByQuestionNumberSpan); QuestionLinkSpans = new WebElementWrapper(ByQuestionLinkSpan); CurrentQuestionInTestSpan = new WebElementWrapper(ByCurrentQuestionInTestSpan); }
/// <summary> /// gets the unique control ID /// </summary> /// <param name="webElement"></param> /// <param name="by"></param> /// <returns></returns> private string GetUniqueId(WebElementWrapper webElement, By by) { string id = webElement.GetAttribute("id"); Report.Write("Got the attribute: 'id' = '" + id + "' of this element by: '" + by.ToString() + "'."); int from = id.IndexOf("_ctl") + "_ctl".Length; int to = id.IndexOf("_", from); //int to = id.LastIndexOf("_"); string index = id.Substring(from, to - from); string uniqueId = "ctl" + index; return(uniqueId); }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { configFrame = new WebElementWrapper(byconfigFrame); NorthRegApply = new WebElementWrapper(byNorthRegApply); SouthRegApply = new WebElementWrapper(bySouthRegApply); SpecRegApply = new WebElementWrapper(bySpecRegApply); NorthRegExpand = new WebElementWrapper(byNorthRegExpand); SouthRegExpand = new WebElementWrapper(bySouthRegExpand); SpecRegExpand = new WebElementWrapper(bySpecRegExpand); NorthRegText = new WebElementWrapper(byNorthRegText); SouthRegText = new WebElementWrapper(bySouthRegText); SpecRegText = new WebElementWrapper(bySpecRegText); }
/// <summary> /// Inside each row for CompletionStatistic grid, there is the Location link. /// This function return the location link value. /// tr.td.a href="TrackTestResults.aspx?id=19504&key=789§ion=False..." /// </summary> /// <param name="rowElement"></param> /// <returns></returns> private string GetLinkRefValue(WebElementWrapper rowElement, By by) { IWebElement linkElement = rowElement.FindElement(by); WebElementWrapper linkElementWrapper = new WebElementWrapper(by); linkElementWrapper.WrappedElement = linkElement; linkElementWrapper.FakeAttributeHref = "TrackTestResults.aspx?id=19504&key=789§ion=False"; string linkReference = linkElementWrapper.GetAttribute("href"); Report.Write("Got link reference: " + linkReference); return(linkReference); }
/// <summary> /// constructor /// </summary> /// <param name="overrideControlPrefix"></param> public PaginationActivities(string overrideControlPrefix = null) : base() { if (overrideControlPrefix != null) { this.ControlPrefix = overrideControlPrefix; } PreviousSetLink = new WebElementWrapper(ByPreviousSetLink); PreviousLink = new WebElementWrapper(ByPreviousLink); QuestionPageLink = new WebElementWrapper(ByQuestionPageLink); NextLink = new WebElementWrapper(ByNextLink); NextSetLink = new WebElementWrapper(ByNextSetLink); }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { BackToPreviousPageTop = new WebElementWrapper(ByBackToPreviousPageTop); Status = new WebElementWrapper(ByStatus); ExcludeLocations = new WebElementWrapper(ByExcludeLocations); CompletionStatisticGrid = new WebElementWrapper(ByCompletionStatisticGrid); CompletionStatisticRows = new WebElementWrapper(ByCompletionStatisticRows); LocationColumn = new WebElementWrapper(ByLocationColumn); ViewDetailsLink = new ViewDetailsLink(PageNames.TrackTestStatus, this.ControlPrefix); PreviousPageBottomLink = new PreviousPageBottomLink(PageNames.TrackTestStatus, this.ControlPrefix); //generates a list on the page load SetCompletionStatisticList(); }
/// <summary> /// intialize elements /// </summary> public override void InitElements() { TestCentralLink = new WebElementWrapper(ByTestCentralLink); TestId = new WebElementWrapper(ByTestId); RecentlyViewedTests = new SelectElementWrapper(new WebElementWrapper(ByRecentlyViewedTests)); SubjectElement subject = new SubjectElement(PageNames.AssessDashboard); SubjectSelect = subject.SelectElement; GradeLevelElement gradeLevel = new GradeLevelElement(PageNames.AssessDashboard); GradeFromSelect = gradeLevel.FromSelectElement; GradeToSelect = gradeLevel.ToSelectElement; }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { SetUniqueControlIdentifiers(); Editor = new Editor(PageNames.EditorPopup, this.ControlPrefix); QuestionContent = new WebElementWrapper(ByQuestionContent); QuestionContentReedit = new WebElementWrapper(ByQuestionContentReedit); ExpectedRequiredErrorsList = new List <string>() { "Enter content", "Select correct answer", "Not worth any points" }; }
/// <summary> /// Will determine if an element's text matches or it's 'value' attribute matches. /// </summary> /// <param name="element"></param> /// <param name="elementText"></param> /// <returns></returns> private bool ElementTextOrValueMatches(IWebElement element, string elementText) { WebElementWrapper wrapper = new WebElementWrapper(element); if (wrapper.TextMatches(elementText)) { return true; } if (wrapper.ValueAttributeMatches(elementText)) { return true; } return false; }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { BenchmarkScoreGroups_Tab = new WebElementWrapper( ByBenchmarkScoreGroups_Tab); DataCollectionAndMonitoring_Tab = new WebElementWrapper( ByDataCollectionAndMonitoring_Tab); Counts_Tab = new WebElementWrapper( ByCounts_Tab); TestingSubjects_Tab = new WebElementWrapper( ByTestingSubjects_Tab); TestProperties_Tab = new WebElementWrapper( ByTestProperties_Tab); ItemProperties_Tab = new WebElementWrapper( ByItemProperties_Tab); CustomDescription_Tab = new WebElementWrapper( ByCustomDescription_Tab); OnlineTesting_Tab = new WebElementWrapper( ByOnlineTesting_Tab); ScanItFormDefinitions_Tab = new WebElementWrapper( ByScanItFormDefinitions_Tab); CMSItemSharing_Tab = new WebElementWrapper( ByCMSItemSharing_Tab); QTIImport_Tab = new WebElementWrapper( ByQTIImport_Tab); }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { Report.Write("Row text: " + Element.Text); CheckBox = new WebElementWrapper(ByCheckBox); CourseName = new WebElementWrapper(ByCourseName); CourseId = new WebElementWrapper(ByCourseId); NumberOfCourse = new WebElementWrapper(ByNumberOfCourse); if (Driver.GetType() == typeof(DummyDriver)) { //set the fake text for the row this.FakeText = this.Element.Text; } }
public override void InitElements() { Report.Write("Row text: " + Element.Text); ItemsText = new WebElementWrapper(ByItemsText); ExpandCollapseImage = new WebElementWrapper(ByExpandCollapseImage); TitleLink = new WebElementWrapper(ByTitleLink); ContentText = new WebElementWrapper(ByContentText); if (Driver.WrappedDriver.GetType() == typeof(DummyDriver)) { //set the fake text for the row this.FakeText = this.Element.Text; } }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { OnlyToMeButton = new WebElementWrapper(ByOnlyToMeButton); ShareWithOthersButton = new WebElementWrapper(ByShareWithOthersButton); DistrictItemAdminsOnlyButton = new WebElementWrapper(ByDistrictItemAdminsOnlyButton); DistrictAndRegionalItemAdminsButton = new WebElementWrapper(ByDistrictAndRegionalItemAdminsButton); DistrictRegionalAndSchoolItemAdminsButton = new WebElementWrapper(ByDistrictRegionalAndSchoolItemAdminsButton); EveryoneButton = new WebElementWrapper(ByEveryoneButton); LimitBySchoolLink = new WebElementWrapper(ByLimitBySchoolLink); ShareWithCoAuthorsButton = new WebElementWrapper(ByShareWithCoAuthorsButton); SearchCoAuthorsNameText = new WebElementWrapper(BySearchCoAuthorsNameText); SearchCoAuthorsRemoveButton = new WebElementWrapper(BySearchCoAuthorsRemoveButton); ViewOnlyButton = new WebElementWrapper(ByViewOnlyButton); }
public override void InitElements() { Report.Write("Row text: " + Element.Text); TestWindowNameLink = new WebElementWrapper(ByTestWindowNameLink); StartDate = new WebElementWrapper(ByStartDate); EndDate = new WebElementWrapper(ByEndDate); if (Driver.WrappedDriver.GetType() == typeof(DummyDriver)) { //set the fake text for the row this.FakeText = this.Element.Text; } }
public void InputFormFields(WebElementWrapper lastElementExecuted) { LastElementExecuted = lastElementExecuted; WaitForEditorToDisplay(); //WaitForFrameToDisplay(); //ReWaitForTinyMceToDisplay(); if (Gaps <= 0) { if (DoFileUpload) { UploadImage(); } WaitForFrameToDisplay(); //WaitForTinyMceToDisplay(); ReWaitForTinyMceToDisplay(); EditorContentArea.SendKeys(ContentData); } else { for (int i = 0; i < Gaps; i++) { if (DoFileUpload) { UploadImage(); } WaitForFrameToDisplay(); WaitForTinyMceToDisplay(); EditorContentArea.SendKeys(GapContentData[i]); this.DriverCommands.WaitToSwitchWindow(_currentWindow, 3); InsertNewGapLink.Wait(3).Click(); //WaitForFrameToDisplay(); //WaitForTinyMceToDisplay(); } WaitForFrameToDisplay(); WaitForTinyMceToDisplay(); EditorContentArea.SendKeys(ContentData); } //Driver.SwitchTo().Window(_currentWindow); this.DriverCommands.WaitToSwitchWindow(_currentWindow, 3); }
/// <summary> /// the constructor /// </summary> /// <param name="uniqueId">the unique ID</param> /// <param name="itemType">the item type</param> /// <param name="overrideControlPrefix">override control prefix</param> public AnswerLineItem(int index, string uniqueId, ItemType itemType, string overrideControlPrefix = null) : base() { this.Index = index; this.UniqueId = uniqueId; this.ItemType = itemType; if (overrideControlPrefix != null) { this.ControlPrefix = overrideControlPrefix; } PointsPossible = new WebElementWrapper(ByPointsPossible()); IsCorrectResponse = new WebElementWrapper(ByIsCorrectResponse()); RemoveLine = new WebElementWrapper(ByRemoveLine()); }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { Report.Write("Row text: " + Element.Text); TestName = new WebElementWrapper(ByTestName); Date = new WebElementWrapper(ByDate); Score = new WebElementWrapper(ByScore); ScoreGroup = new WebElementWrapper(ByScoreGroup); if (Driver.WrappedDriver.GetType() == typeof(DummyDriver)) { //set the fake text for the row this.FakeText = this.Element.Text; } }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { ScheduleInformationLink = new WebElementWrapper(ByScheduleInformationLink); StartDateLabel = new WebElementWrapper(ByStartDateLabel); EndDateLabel = new WebElementWrapper(ByEndDateLabel); ScoreDateLabel = new WebElementWrapper(ByScoreDateLabel); TestIsRecommendedAssignedToSchoolsLabel = new WebElementWrapper(ByTestIsRecommendedAssignedToSchoolsLabel); TestIsRecommendedAssignedToCoursesLabel = new WebElementWrapper(ByTestIsRecommendedAssignedToCoursesLabel); TestResultsWillNotBeExportedLabel = new WebElementWrapper(ByTestResultsWillNotBeExportedLabel); EditScheduleAndSettingsLink = new WebElementWrapper(ByEditScheduleAndSettingsLink); ViewAssignmentSummaryLink = new WebElementWrapper(ByViewAssignmentSummaryLink); ScheduleTestLink = new WebElementWrapper(ByScheduleTestLink); TestWindowLink = new WebElementWrapper(ByTestWindowLink); }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { Report.Write("Row text: " + Element.Text); TestNameLink = new WebElementWrapper(ByTestNameLink); EndDate = new WebElementWrapper(ByEndDate); ScoresDueDate = new WebElementWrapper(ByScoresDueDate); CollectionStatus = new WebElementWrapper(ByCollectionStatus); if (Driver.WrappedDriver.GetType() == typeof(DummyDriver)) { //set the fake text for the row this.FakeText = this.Element.Text; } }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { Report.Write("Row value: " + Element.GetAttribute("value")); NameText = new WebElementWrapper(ByNameText); AddressText = new WebElementWrapper(ByAddressText); EnabledCheck = new WebElementWrapper(ByEnabledCheck); RemoveImage = new WebElementWrapper(ByRemoveImage); if (Driver.WrappedDriver.GetType() == typeof(DummyDriver)) { //set the fake text for the row //this.FakeText = this.Element.Text; this.FakeText = this.Element.GetAttribute("value"); } }
/// <summary> /// constructor /// </summary> /// <param name="itemid"></param> /// <param name="index"></param> /// <param name="uniqueId"></param> /// <param name="parentWindow"></param> /// <param name="overrideControlPrefix"></param> public AttachRubricLineItem(int itemid, int index, string uniqueId, string parentWindow, string overrideControlPrefix = null) : base() { if (overrideControlPrefix != null) { this.ControlPrefix = overrideControlPrefix; } ItemId = itemid; Index = index; UniqueId = uniqueId; ParentWindow = parentWindow; AttachButton = new WebElementWrapper(ByAttachButton); }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { Report.Write("Row text: " + Element.Text); TestNameLink = new WebElementWrapper(ByTestNameLink); NumberOfItems = new WebElementWrapper(ByNumberOfItems); TestStage = new WebElementWrapper(ByTestStage); ModifiedDate = new WebElementWrapper(ByModifiedDate); if (Driver.WrappedDriver.GetType() == typeof(DummyDriver)) { //set the fake text for the row this.FakeText = this.Element.Text; } }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { // KPI Tables - Grade-Stud Subgroups-Region KpiTables = new WebElementWrapper(byKpiTables); KpiTableheader = new WebElementWrapper(byKpiTables); KpiDataTable = new WebElementWrapper(byKpiTables); KpiDataTableColheader = new WebElementWrapper(byKpiTables); KpiData_NestTable = new WebElementWrapper(byKpiTables); KpiDataTablerow = new WebElementWrapper(byKpiTables); KpiDataNestTableCol = new WebElementWrapper(byKpiTables); // KPI Tables - Related Items Kpirelatedtables = new WebElementWrapper(byKpiTables); KpirelatedDataheader = new WebElementWrapper(byKpiTables); }
/// <summary> /// gets the line item rows from the test content grid, /// creates test content line item components, /// assigns the primary identifiers to each line item component, /// and stores them in a collection /// </summary> private void SetTestContentList() { ItemContentList = new List <ItemContentLineItem>(); ItemContentGrid.Wait(3); try { //get the list of items added to the task ItemContentWebElementList = ItemContentRows.WaitForElements(5); if (Driver.GetType() == typeof(DummyDriver)) { DummyWebElement dummy1 = new DummyWebElement(); dummy1.FakeAttributeId = "Anchor256324"; dummy1.FakeAttributeName = "Anchor256324"; DummyWebElement dummy2 = new DummyWebElement(); dummy2.FakeAttributeId = "Anchor256325"; dummy2.FakeAttributeName = "Anchor256325"; List <IWebElement> list = new List <IWebElement> { dummy1, dummy2 }; ItemContentWebElementList = new ReadOnlyCollection <IWebElement>(list); } } catch (Exception e) { //no items have been added to the task yet ItemContentWebElementList = null; } //if the task contains a list of items if (ItemContentWebElementList != null) { int index = 0; foreach (var webElement in ItemContentWebElementList) { string id = webElement.GetAttribute("id"); int itemid = int.Parse(GetItemId(id)); QuestionLabel = new WebElementWrapper(ByQuestionLabelLocator(id)); QuestionLabel.FakeAttributeId = "ctl00_MainContent_EditTestItemControl_EditTaskItemControl1_ViewTaskItemControl_RepeaterTaskItems_ctl01_LabelQuestionLabel"; string uniqueId = GetUniqueId(QuestionLabel, ByQuestionLabelLocator(id)); QuestionLabel.Text = "A"; string label = QuestionLabel.Text; Report.Write("ItemContentLineItem by itemid: '" + itemid + "'; index: '{" + index + "'; uniqueId: '" + uniqueId + "'; label: '" + label); var lineItem = new ItemContentLineItem(webElement, itemid, index, uniqueId, label); ItemContentList.Add(lineItem); index++; } } }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { //Subject = new Subject(PageNames.TestWindowViewTestWindow); //GradeLevel = new GradeLevel(PageNames.TestWindowViewTestWindow, this.ControlPrefix); SubjectElement subject = new SubjectElement(PageNames.TestWindowViewTestWindow); SubjectSelect = subject.SelectElement; GradeLevelElement gradeLevel = new GradeLevelElement(PageNames.TestWindowViewTestWindow); GradeFromSelect = gradeLevel.FromSelectElement; GradeToSelect = gradeLevel.ToSelectElement; TestWindowName = new WebElementWrapper(ByTestWindowName); DateFrom = new WebElementWrapper(ByDateFrom); DateTo = new WebElementWrapper(ByDateTo); Grid = new PlanHomeGrid(GridLocator); }
private bool IsEnabled(WebElementWrapper element) { bool isEnabled = true; //use wait until exists because Dev uses 2 different 'a' tags for each link, and they toggle which is enabled element.WaitUntilExists(3); if (Driver.WrappedDriver.GetType() == typeof(DummyDriver)) { element.FakeAttributeClass = FakeText; } if (element.GetAttribute("class").Trim().ToLower().Contains("aspNetDisabled".ToLower())) { return(false); } return(isEnabled); }
/// <summary> /// initialize elements /// </summary> public override void InitElements() { //Subject = new Subject(PageNames.TestWindowCreateEditTestWindow); //GradeLevel = new GradeLevel(PageNames.TestWindowCreateEditTestWindow, this.ControlPrefix); SubjectElement subject = new SubjectElement(PageNames.TestWindowCreateEditTestWindow); SubjectSelect = subject.SelectElement; GradeLevelElement gradeLevel = new GradeLevelElement(PageNames.TestWindowCreateEditTestWindow); GradeFromSelect = gradeLevel.FromSelectElement; GradeToSelect = gradeLevel.ToSelectElement; TestWindowName = new WebElementWrapper(ByTestWindowName); DateFrom = new WebElementWrapper(ByDateFrom); DateTo = new WebElementWrapper(ByDateTo); Description = new WebElementWrapper(ByDescription); }
/// <summary> /// Initializes the Elements for this Class /// </summary> public override void InitElements() { Report.Write("Row text: " + Element.Text); TestNameLink = new WebElementWrapper(ByTestNameLink); Subject = new WebElementWrapper(BySubject); GradeLevel = new WebElementWrapper(ByGradeLevel); TestStage = new WebElementWrapper(ByTestStage); ModifiedDate = new WebElementWrapper(ByModifiedDate); if (Driver.GetType() == typeof(DummyDriver)) { //set the fake text for the row this.FakeText = this.Element.Text; } }
public override void InitElements() { Report.Write("Row text: " + Element.Text); AddNewRoleLink = new WebElementWrapper(ByAddNewRoleLink); RoleName = new WebElementWrapper(ByRoleName); Description = new WebElementWrapper(ByDescription); OperationTemplates = new WebElementWrapper(ByOperationTemplates); EditRoleLink = new WebElementWrapper(ByEditRoleLink); EditRoleMembershipLink = new WebElementWrapper(ByEditRoleMembershipLink); if (Driver.GetType() == typeof(DummyDriver)) { //set the fake text for the row this.FakeText = this.Element.Text; } }