/// <summary>
        /// Gets the Dummy Column List
        /// </summary>
        /// <returns></returns>
        public override List <IWebElement> GetDummyElementsColumns()
        {
            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                if (DummyElementColumnList == null)
                {
                    DummyWebElement dummy1 = new DummyWebElement();
                    dummy1.Text = "Test Name";
                    dummy1.FakeAttributeClass = "sortable";
                    DummyWebElement dummy2 = new DummyWebElement();
                    dummy2.Text = "Subject";
                    dummy2.FakeAttributeClass = "sortable";
                    DummyWebElement dummy3 = new DummyWebElement();
                    dummy3.Text = "Grade Level";
                    dummy3.FakeAttributeClass = "sortable";
                    DummyWebElement dummy4 = new DummyWebElement();
                    dummy4.Text = "Test Stage";
                    DummyWebElement dummy5 = new DummyWebElement();
                    dummy5.Text = "Start Date";
                    dummy5.FakeAttributeClass = "sortable ascending";
                    DummyWebElement dummy6 = new DummyWebElement();
                    dummy6.Text = "End Date";
                    dummy6.FakeAttributeClass = "sortable";
                    DummyWebElement dummy7 = new DummyWebElement();
                    dummy7.Text = "Scores Due Date";
                    dummy7.FakeAttributeClass = "sortable";

                    DummyElementColumnList = new List <IWebElement> {
                        dummy1, dummy2, dummy3, dummy4, dummy5, dummy6, dummy7
                    };
                }
            }
            return(DummyElementColumnList);
        }
Пример #2
0
        /// <summary>
        /// Gets the Dummy Data Row List
        /// </summary>
        /// <returns></returns>
        public override List <IWebElement> GetDummyElementsDataRows()
        {
            if (Driver.GetType() == typeof(DummyDriver))
            {
                if (DummyElementDataRowList == null)
                {
                    DummyWebElement dummy1 = new DummyWebElement();
                    dummy1.Text             = @"
			            <div style='padding-bottom:5px; display:block'>&nbsp;</div>
			            <div id='divPassageContent_0' class='ItemPassageControl_Maximized' style='overflow:hidden;'>
				            <div style='padding-bottom:5px'>
				                <b><a id='ctl00_MainContent_ItemPassageControl_gridPassages_ctl02_LinkButtonPassageTitle' passage_id='55464' href='javascript:__doPostBack('ctl00$MainContent$ItemPassageControl$gridPassages$ctl02$LinkButtonPassageTitle','')'>Web Test Passage: 25376</a></b>
				            </div>
				            <div style='padding-bottom:5px' class='ie_image_fix line-height-normal'>
				                <p>The FIFA World Cup (also called the Football World Cup, the Soccer World Cup, or simply the World Cup) is an international association football competition contested by the senior men's national teams of the members of Federation International de Football Association (FIFA), the sport's global governing body. The championship has been awarded every four years since the inaugural tournament in 1930, except in 1942 and 1946 when it was not held because of the Second World War. The current champions are Spain, who won the 2010 tournament. The current format of the tournament involves 32 teams competing for the title at venues within the host nation(s) over a period of about a month - this phase is often called the World Cup Finals. A qualification phase, which currently takes place over the preceding three years, is used to determine which teams qualify for the tournament together with the host nation(s).The 19 World Cup tournaments have been won by eight different national teams. Brazil have won five times, and they are the only team to have played in every tournament. The other World Cup winners are Italy, with four titles; Germany, with three titles; Argentina and inaugural winners Uruguay, with two titles each; and England, France, and Spain, with one title each. The World Cup is the world's most widely viewed sporting event; an estimated 715.1 million people watched the final match of the 2006 FIFA World Cup held in Germany. The next three World Cups will be hosted by Brazil in 2014, Russia in 2018, and Qatar in 2022</p>
				            </div>
			            </div>
			        "            ;
                    DummyElementDataRowList = new List <IWebElement> {
                        dummy1
                    };
                }
            }
            return(DummyElementDataRowList);
        }
Пример #3
0
        /// <summary>
        /// Verified a specific Nth question is not Unanswered
        /// </summary>
        /// <param name="index">Index start at 0, 1, 2. 0th is 1st question</param>
        /// <returns>true or false</returns>
        public bool VerifyQuestionIsUnAnswered(int index)
        {
            UnAnsweredQuestionLinkWebElementList = UnAnsweredQuestionLinks.WaitForElements(3);

            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                List <IWebElement> dummyList = new List <IWebElement>();
                DummyWebElement    dummy     = new DummyWebElement();
                dummy.FakeAttributeAriaLabel = "Question " + Convert.ToString(index + 1);
                dummyList = new List <IWebElement> {
                    dummy
                };

                UnAnsweredQuestionLinkWebElementList = new ReadOnlyCollection <IWebElement>(dummyList);
            }

            foreach (var webElement in UnAnsweredQuestionLinkWebElementList)
            {
                //<a aria-label="Question 2 Unanswered" role="link" class=" unanswered" tabindex="0">Unanswered</a>
                string actualLabel = webElement.GetAttribute("aria-label");
                string expectLabel = "Question " + Convert.ToString(index + 1);
                if (actualLabel.Contains(expectLabel))
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #4
0
        private void SetAvailableStandardsGroupList()
        {
            AvailableStandardsGroupList = new List <SelectedStandardsAvailableLineItem>();
            //wait to find the VISIBLE element for a specified amount of time
            AvailableStandardsList.Wait(5);
            //wait to find the list of EXISTING elements (VISIBLE or INVISIBLE) for a specified amount of time
            AvailableStandardsWebElementList = AvailableStandardsItems.WaitForElements(5);
            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                DummyWebElement dummy1 = new DummyWebElement();
                dummy1.FakeAttributeId  = "ctl00_MainContent_TestMapControl1_RepeaterTestMap_ctl00_TextBoxItems";
                dummy1.FakeAttributeKey = "17713";
                //dummy1.FakeAttributeNk = "ACT-Alg1-D";
                DummyWebElement dummy2 = new DummyWebElement();
                dummy2.FakeAttributeId  = "ctl00_MainContent_TestMapControl1_RepeaterTestMap_ctl01_TextBoxItems";
                dummy2.FakeAttributeKey = "17714";
                //dummy2.FakeAttributeNk = "ACT-Alg1-D.1";
                List <IWebElement> list = new List <IWebElement> {
                    dummy1, dummy2
                };
                AvailableStandardsWebElementList = new ReadOnlyCollection <IWebElement>(list);
            }

            foreach (var webElement in AvailableStandardsWebElementList)
            {
                int    standardId = int.Parse(webElement.GetAttribute("key"));
                string controlId  = webElement.GetAttribute("id");
                Report.Write("SelectedStandardsAvailableLineItem by standardId: '" + standardId + "'; controlId: '" + controlId);
                var standardsLineItem = new SelectedStandardsAvailableLineItem(webElement, standardId, controlId);
                AvailableStandardsGroupList.Add(standardsLineItem);
            }
        }
        private ReadOnlyCollection <IWebElement> GetDummyIdentifiers()
        {
            ReadOnlyCollection <IWebElement> webElements = null;
            List <IWebElement> list   = new List <IWebElement>();
            DummyWebElement    dummy1 = new DummyWebElement();
            DummyWebElement    dummy2 = new DummyWebElement();
            DummyWebElement    dummy3 = new DummyWebElement();
            DummyWebElement    dummy4 = new DummyWebElement();
            DummyWebElement    dummy5 = new DummyWebElement();
            DummyWebElement    dummy6 = new DummyWebElement();
            DummyWebElement    dummy7 = new DummyWebElement();
            DummyWebElement    dummy8 = new DummyWebElement();
            DummyWebElement    dummy9 = new DummyWebElement();

            dummy1.FakeAttributeId = "grid_0";
            dummy2.FakeAttributeId = "grid_1";
            dummy3.FakeAttributeId = "grid_2";
            dummy4.FakeAttributeId = "grid_3";
            dummy5.FakeAttributeId = "grid_4";
            dummy6.FakeAttributeId = "grid_5";
            dummy7.FakeAttributeId = "grid_6";
            dummy8.FakeAttributeId = "grid_7";
            dummy9.FakeAttributeId = "grid_8";

            list = new List <IWebElement> {
                dummy1, dummy2, dummy3, dummy4, dummy5, dummy6, dummy7, dummy8, dummy9
            };
            webElements = new ReadOnlyCollection <IWebElement>(list);
            return(webElements);
        }
        /// <summary>
        /// sets the question gap list
        /// </summary>
        public void SetQuestionGapList()
        {
            QuestionGapList = new List <QuestionGap>();
            QuestionLabel.Wait(3);
            QuestionGapWebElementList = QuestionGapsDropdowns.WaitForElements(5);

            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                List <IWebElement> list   = new List <IWebElement>();
                DummyWebElement    dummy1 = new DummyWebElement();
                DummyWebElement    dummy2 = new DummyWebElement();
                DummyWebElement    dummy3 = new DummyWebElement();
                dummy1.FakeAttributeClass = "This morning, I went to the ";
                dummy2.FakeAttributeClass = "and bought some milk and eggs. I knew it was going to rain, but I forgot my ";
                dummy3.FakeAttributeClass = "and ended up getting ";
                list = new List <IWebElement> {
                    dummy1, dummy2, dummy3
                };
                QuestionGapWebElementList = new ReadOnlyCollection <IWebElement>(list);
            }

            int index = 0;

            foreach (var webElement in QuestionGapWebElementList)
            {
                Report.Write("QuestionGap index: '" + index);
                var answerLineItem = new QuestionGap(index);
                QuestionGapList.Add(answerLineItem);
                index++;
            }
        }
        /// <summary>
        /// Gets the Dummy Data Row List
        /// </summary>
        /// <returns></returns>
        public override List <IWebElement> GetDummyElementsDataRows()
        {
            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                if (DummyElementDataRowList == null)
                {
                    DummyWebElement dummy1 = new DummyWebElement();
                    dummy1.FakeAttributeValue = "dd IP";

                    /*dummy1.Text = @"<td><input name='' value='dd IP' maxlength='255' id='' class='' onblur='' type='text'></td>
                     *              <td><input type='text' id='' maxlength='20' value='172.24.166.148' name=''></td>";*/
                    DummyWebElement dummy2 = new DummyWebElement();
                    dummy2.FakeAttributeValue = "ab IP";

                    /*dummy2.Text = @"<td><input name='' value='ab IP' maxlength='255' id='' class='' onblur='' type='text'></td>
                     *              <td><input type='text' id='' maxlength='20' value='172.24.166.154' name=''></td>";*/
                    DummyWebElement dummy3 = new DummyWebElement();
                    dummy3.FakeAttributeValue = "172.24.166.148";
                    DummyWebElement dummy4 = new DummyWebElement();
                    dummy4.FakeAttributeValue = "172.24.166.154";
                    DummyElementDataRowList   = new List <IWebElement> {
                        dummy1, dummy2, dummy3, dummy4
                    };
                }
            }
            return(DummyElementDataRowList);
        }
Пример #8
0
 /// <summary>
 /// Gets the Dummy Data Row List
 /// </summary>
 /// <returns></returns>
 public override List <IWebElement> GetDummyElementsDataRows()
 {
     if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
     {
         if (DummyElementDataRowList == null)
         {
             DummyWebElement dummy1 = new DummyWebElement();
             dummy1.FakeAttributeValue = "Needs Improvement";
             dummy1.FakeAttributeName  = "60";
             dummy1.Text = @"<td><input type='text' value='Needs Improvement'></td>
                             <td></td>
                             <td><span class='smallBox span1'>0</span> <span>%</span><span>up to </span> <input type='text' value='60'> <span> %</span></td>";
             DummyWebElement dummy2 = new DummyWebElement();
             dummy2.FakeAttributeValue = "Satisfactory";
             dummy2.FakeAttributeName  = "75";
             dummy2.Text = @"<td><input type='text' value='Satisfactory'></td>
                             <td></td>
                             <td><span class='smallBox span1'>60</span> <span>%</span><span>up to </span> <input type='text' value='75'> <span> %</span></td>";
             DummyWebElement dummy3 = new DummyWebElement();
             dummy3.FakeAttributeValue = "Excellent";
             dummy3.FakeAttributeName  = "";
             dummy3.Text             = @"<td><input type='text' value='Excellent'></td>
                             <td></td>
                             <td><span class='smallBox span1'>75</span> <span>%</span><span>up to </span> <span>100</span> <span> %</span></td>";
             DummyElementDataRowList = new List <IWebElement> {
                 dummy1, dummy2, dummy3
             };
         }
     }
     return(DummyElementDataRowList);
 }
Пример #9
0
 /// <summary>
 /// Gets the Dummy Column List
 /// </summary>
 /// <returns></returns>
 public override List <IWebElement> GetDummyElementsColumns()
 {
     if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
     {
         if (DummyElementColumnList == null)
         {
             DummyWebElement dummy1 = new DummyWebElement();
             dummy1.Text = "Item #";
             DummyWebElement dummy2 = new DummyWebElement();
             dummy2.Text = "Standard Mapped to";
             DummyWebElement dummy3 = new DummyWebElement();
             dummy3.Text = "Standards Document";
             DummyWebElement dummy4 = new DummyWebElement();
             dummy4.Text = "Correct Answer";
             DummyWebElement dummy5 = new DummyWebElement();
             dummy5.Text = "Student's Answer";
             DummyWebElement dummy6 = new DummyWebElement();
             dummy6.Text            = "Total Score";
             DummyElementColumnList = new List <IWebElement> {
                 dummy1, dummy2, dummy3, dummy4, dummy5, dummy6
             };
         }
     }
     return(DummyElementColumnList);
 }
        protected ReadOnlyCollection <IWebElement> GetDummyStepsToCompleteLabels()
        {
            ReadOnlyCollection <IWebElement> webElements = null;
            List <IWebElement> list   = new List <IWebElement>();
            DummyWebElement    dummy1 = new DummyWebElement();
            DummyWebElement    dummy2 = new DummyWebElement();
            DummyWebElement    dummy3 = new DummyWebElement();
            DummyWebElement    dummy4 = new DummyWebElement();
            DummyWebElement    dummy5 = new DummyWebElement();

            dummy1.Text      = expectedRequiredErrorsList[0];
            dummy1.Displayed = true;
            dummy2.Text      = expectedRequiredErrorsList[1];
            dummy2.Displayed = true;
            dummy3.Text      = expectedRequiredErrorsList[2];
            dummy3.Displayed = true;
            dummy4.Text      = expectedRequiredErrorsList[3];
            dummy4.Displayed = true;
            dummy5.Text      = expectedRequiredErrorsList[4];
            dummy5.Displayed = true;

            list = new List <IWebElement> {
                dummy1, dummy2, dummy3, dummy4, dummy5
            };
            webElements = new ReadOnlyCollection <IWebElement>(list);
            return(webElements);
        }
Пример #11
0
        /// <summary>
        /// Generate a list of item for the component on the review a test grid
        /// </summary>
        private void SetReviewTestList()
        {
            ReviewLineItemList          = new List <ReviewTestLineItem>();
            ReviewTestRowWebElementList = ReviewTestGrid.WaitForElements(5);

            if (Driver.GetType() == typeof(DummyDriver))
            {
                DummyWebElement dummy1 = new DummyWebElement();
                dummy1.TagName            = "div";
                dummy1.FakeAttributeId    = "ctl00MainContentctl00ctl00WebPartManager1wp1078669889wp452309171_RepeaterLatestTests_ctl01_panel2";
                dummy1.FakeAttributeClass = "space1";
                DummyWebElement dummy2 = new DummyWebElement();
                dummy2.TagName            = "div";
                dummy2.FakeAttributeId    = "ctl00MainContentctl00ctl00WebPartManager1wp1078669889wp452309171_RepeaterLatestTests_ctl02_panel2";
                dummy2.FakeAttributeClass = "space1";

                List <IWebElement> list = new List <IWebElement> {
                    dummy1, dummy2
                };
                ReviewTestRowWebElementList = new ReadOnlyCollection <IWebElement>(list);
            }

            int index = 0;

            foreach (var webElement in ReviewTestRowWebElementList)
            {
                string             uniqueId = webElement.GetAttribute("id");
                ReviewTestLineItem lineItem = new ReviewTestLineItem(index, uniqueId);
                ReviewLineItemList.Add(lineItem);
                index++;
            }
        }
Пример #12
0
        private void SetSearchResultList()
        {
            SearchResultList           = new List <SearchResultLineItem>();
            SearchResultWebElementList = SearchResultRows.WaitForElements(5);
            if (Driver.GetType() == typeof(DummyDriver))
            {
                DummyWebElement dummy1 = new DummyWebElement();
                dummy1.TagName            = "tr";
                dummy1.FakeAttributeClass = "DataGridAltRow";
                DummyWebElement dummy2 = new DummyWebElement();
                dummy2.TagName            = "tr";
                dummy2.FakeAttributeClass = "DataGridAltRow";
                List <IWebElement> list = new List <IWebElement> {
                    dummy1, dummy2
                };
                SearchResultWebElementList = new ReadOnlyCollection <IWebElement>(list);
            }

            int index = 0;

            foreach (var webElement in SearchResultWebElementList)
            {
                Report.Write("Grid Row: " + webElement.Text);
                SearchResultLineItem lineItem = new SearchResultLineItem(index);
                SearchResultList.Add(lineItem);
                index++;
            }
        }
        /// <summary>
        /// sets the question stem list.
        /// </summary>
        public void SetQuestionStemList()
        {
            QuestionStemList = new List <QuestionLineItem>();
            QuestionGrid.Wait(3);
            QuestionContentWebElementList = QuestionContentRows.WaitForElements(5);

            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                DummyWebElement dummy1 = new DummyWebElement();
                dummy1.Text = "banana";
                DummyWebElement dummy2 = new DummyWebElement();
                dummy2.Text = "carrot";
                DummyWebElement dummy3 = new DummyWebElement();
                dummy3.Text = "eggplant";
                List <IWebElement> list = new List <IWebElement> {
                    dummy1, dummy2, dummy3
                };
                QuestionContentWebElementList = new ReadOnlyCollection <IWebElement>(list);
            }

            int index = 0;

            foreach (var webElement in QuestionContentWebElementList)
            {
                string question = webElement.Text.Trim();
                Report.Write("QuestionLineItem index: '" + index + "'; question: '" + question);
                var questionLineItem = new QuestionLineItem(index, question);
                QuestionStemList.Add(questionLineItem);
                index++;
            }
        }
        private void SetAttachRubricWeightList()
        {
            AttachRubricWeightList = new List <AttachRubricPointsLineItem>();
            WeightGrid.Wait(3);
            AttachRubricWeightWebElementList = WeightRows.WaitForElements(5);
            if (Driver.GetType() == typeof(DummyDriver))
            {
                DummyWebElement dummy = new DummyWebElement();

                List <IWebElement> list = new List <IWebElement> {
                    dummy, dummy, dummy, dummy
                };
                AttachRubricWeightWebElementList = new ReadOnlyCollection <IWebElement>(list);
            }

            int index = 0;

            foreach (var webElement in AttachRubricWeightWebElementList)
            {
                string uniqueId = null;
                uniqueId = GetUniqueId(index);

                var lineItem = new AttachRubricPointsLineItem(index, uniqueId);
                AttachRubricWeightList.Add(lineItem);
                index++;
            }
        }
Пример #15
0
        /// <summary>
        /// verify operation available
        /// </summary>
        public void VerifyOperationAvailable()
        {
            OperationAvailable.Wait(3);
            IList <IWebElement> list;

            if (Driver.GetType() == typeof(DummyDriver))
            {
                DummyWebElement dummy1 = new DummyWebElement();
                dummy1.Text = Data.OperationToAdd;
                OperationAvailable.FakeOptionsList = new List <IWebElement> {
                    dummy1
                };
            }
            list = OperationAvailable.Options;
            bool isFound = false;

            foreach (var webElement in list)
            {
                Report.Write("OperationAvailable value: " + webElement.GetAttribute("value") + "; text: " + webElement.Text);
                if (webElement.Text.Equals(Data.OperationToAdd))
                {
                    isFound = true;
                }
            }
            Assert.IsTrue(isFound, "Verified the operation '" + Data.OperationToAdd + "' is not available.");
        }
        private void SetItemCentralResultList()
        {
            var dictionary = new Dictionary <int, string>();

            ItemsLinkedToPassageList = new List <ItemsLinkedToPassageLineItem>();
            bool isFound = true;

            try
            {
                ItemsLinkedToPassageWebElementList  = ItemsLinkedToPassageRows.WaitForElements(5);
                ItemsLinkedToPassageWebElementList2 = ItemsLinkedToPassageRows2.WaitForElements(5);
                if (Driver.GetType() == typeof(DummyDriver))
                {
                    DummyWebElement dummy1 = new DummyWebElement();
                    dummy1.FakeAttributeId     = "ctl00_MainContent_RepeaterTestItemsLinkedToPassage_ctl00_CheckBoxAddToTest";
                    dummy1.FakeAttributeDetail = "testItemDetail339338";
                    DummyWebElement dummy2 = new DummyWebElement();
                    dummy2.FakeAttributeId     = "ctl00_MainContent_RepeaterTestItemsLinkedToPassage_ctl01_CheckBoxAddToTest";
                    dummy2.FakeAttributeDetail = "testItemDetail339339";
                    List <IWebElement> list = new List <IWebElement> {
                        dummy1, dummy2
                    };
                    ItemsLinkedToPassageWebElementList  = new ReadOnlyCollection <IWebElement>(list);
                    ItemsLinkedToPassageWebElementList2 = new ReadOnlyCollection <IWebElement>(list);
                }
            }
            catch (Exception exception)
            {
                isFound = false;
            }

            if (isFound == true)
            {
                int index = 0;
                foreach (var webElement in ItemsLinkedToPassageWebElementList)
                {
                    string itemid = webElement.GetAttribute("_detail");
                    dictionary.Add(index, itemid);
                    index++;
                }

                index = 0;
                foreach (var webElement in ItemsLinkedToPassageWebElementList2)
                {
                    string idAttribute = webElement.GetAttribute("id");
                    Report.Write("Got the attribute: 'id' = '" + idAttribute + "' of this element by: '" + ByItemsLinkedToPassageRows2.ToString() + "'.");
                    int    from     = idAttribute.IndexOf("_ctl") + "_ctl".Length;
                    int    to       = idAttribute.LastIndexOf("_");
                    string ctl      = idAttribute.Substring(from, to - from);
                    string uniqueId = "ctl" + ctl;
                    string itemid   = dictionary[index];
                    Report.Write("ItemsLinkedToPassageLineItem by itemid: '" + itemid + "'; index: '" + index + "'; uniqueId: '" + uniqueId);
                    var lineItem = new ItemsLinkedToPassageLineItem(itemid, index, uniqueId);
                    ItemsLinkedToPassageList.Add(lineItem);
                    index++;
                }
            }
        }
Пример #17
0
        /// <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()
        {
            TestContentList = new List <TestContentLineItem>();
            TestContentGrid.Wait(3);
            TestContentWebElementList = TestContentRows.WaitForElements(5);
            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                DummyWebElement dummy1 = new DummyWebElement();
                dummy1.FakeAttributeId   = "Anchor326237"; //"256324";
                dummy1.FakeAttributeName = "Anchor326237"; //"256324";
                DummyWebElement dummy2 = new DummyWebElement();
                dummy2.FakeAttributeId   = "Anchor326238"; //"256325";
                dummy2.FakeAttributeName = "Anchor326238"; //"256325";
                DummyWebElement dummy3 = new DummyWebElement();
                dummy3.FakeAttributeId   = "Anchor326239";
                dummy3.FakeAttributeName = "Anchor326239";
                DummyWebElement dummy4 = new DummyWebElement();
                dummy4.FakeAttributeId   = "Anchor326240";
                dummy4.FakeAttributeName = "Anchor326240";
                DummyWebElement dummy5 = new DummyWebElement();
                dummy5.FakeAttributeId   = "Anchor326241";
                dummy5.FakeAttributeName = "Anchor326241";
                DummyWebElement dummy6 = new DummyWebElement();
                dummy6.FakeAttributeId   = "Anchor326242";
                dummy6.FakeAttributeName = "Anchor326242";
                DummyWebElement dummy7 = new DummyWebElement();
                dummy7.FakeAttributeId   = "Anchor326243";
                dummy7.FakeAttributeName = "Anchor326243";
                DummyWebElement dummy8 = new DummyWebElement();
                dummy8.FakeAttributeId   = "Anchor326244";
                dummy8.FakeAttributeName = "Anchor326244";
                DummyWebElement dummy9 = new DummyWebElement();
                dummy9.FakeAttributeId   = "Anchor326245";
                dummy9.FakeAttributeName = "Anchor326245";
                List <IWebElement> list = new List <IWebElement> {
                    dummy1, dummy2, dummy3, dummy4, dummy5, dummy6, dummy7, dummy8, dummy9
                };
                TestContentWebElementList = new ReadOnlyCollection <IWebElement>(list);
            }

            int index = 0;

            foreach (var webElement in TestContentWebElementList)
            {
                string id     = webElement.GetAttribute("id");
                int    itemid = int.Parse(GetItemId(id));
                QuestionLabel = new WebElementWrapper(ByQuestionLabelLocator(id));
                QuestionLabel.FakeAttributeId = "ctl00_MainContent_RepeaterTestItems_ctl01_ViewTestItems1_LabelQuestionLabel";
                string uniqueId = GetUniqueId(QuestionLabel, ByQuestionLabelLocator(id));
                QuestionLabel.Text = "" + index + 1;
                string label = QuestionLabel.Text;
                Report.Write("TestContentLineItem by itemid: '" + itemid + "'; index: '" + index
                             + "'; uniqueId: '" + uniqueId + "'; label: '" + label);
                var lineItem = new TestContentLineItem(webElement, itemid, index, uniqueId, label);
                TestContentList.Add(lineItem);
                index++;
            }
        }
Пример #18
0
        private void SetUniqueControlIdentifiers()
        {
            AnswerChoiceTabs = new Dictionary <string, ItemTypeTabForm>();
            InteractionTabs.WaitUntilVisible();
            //get the tabs
            ReadOnlyCollection <IWebElement> webElementTabs = Driver.FindElements(ByInteractionTabs);

            Report.Write("Found the elements by: '" + ByInteractionTabs.ToString() + "'.");
            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                DummyWebElement dummy1 = new DummyWebElement();
                dummy1.FakeAttributeId    = "tabfc5d6a01-9539-46d2-966a-15ab568698e8";
                dummy1.FakeAttributeClass = "active";
                DummyWebElement dummy2 = new DummyWebElement();
                dummy2.FakeAttributeId    = "tabe2e3dda0-5708-40b5-8354-198a1232176a";
                dummy2.FakeAttributeClass = "";
                DummyWebElement dummy3 = new DummyWebElement();
                dummy3.FakeAttributeId    = "tab76962807-988c-4d06-b977-9f9a4c35d87f";
                dummy3.FakeAttributeClass = "";
                List <IWebElement> list = new List <IWebElement> {
                    dummy1, dummy2, dummy3
                };
                webElementTabs = new ReadOnlyCollection <IWebElement>(list);
            }

            int dummyindex = 1;
            int index      = 0;

            foreach (var webElement in webElementTabs)
            {
                string tempTabId = webElement.GetAttribute("id");
                Report.Write("Got the attribute: 'id' = '" + tempTabId + "' of this element by: '" + ByInteractionTabs.ToString() + "'.");

                //parse the tab ids to get the root id
                int    from  = tempTabId.IndexOf("tab") + "tab".Length;
                string tabId = tempTabId.Substring(from);

                string tabClass = webElement.GetAttribute("class");
                Report.Write("Got the attribute: 'class' = '" + tabClass + "' of this element by: '" + ByInteractionTabs.ToString() + "'.");
                InteractionTab = new WebElementWrapper(By.CssSelector("#tab" + tabId + " > a"));
                InteractionTab.Wait(3).Text = "" + dummyindex;
                dummyindex++;
                string tabName = InteractionTab.Text.Trim();
                //string tabName, string tabId, string tabClass
                Report.Write("Tab control identifier by tabName: " + tabName + "; tabId: " + tabId + "; tabClass: " + tabClass);
                //click the tab to make it visible, then create the item type tab object
                InteractionTab.Click();
                //create an item type tab object
                var itemTypeFormTab = new ItemTypeTabForm(ItemType.InlineResponse, tabName, tabId, tabClass,
                                                          index, ControlPrefix);
                //add the item type tab object to the collection (1, 2, 3)
                AnswerChoiceTabs.Add(tabName, itemTypeFormTab);
                index = index + 1000;
            }
        }
Пример #19
0
        private ReadOnlyCollection <IWebElement> GetDummyIdentifiers(int numberOfElementsInListToBeReturned = 5)
        {
            ReadOnlyCollection <IWebElement> webElements = null;
            List <IWebElement> list   = new List <IWebElement>();
            DummyWebElement    dummy1 = new DummyWebElement();
            DummyWebElement    dummy2 = new DummyWebElement();
            DummyWebElement    dummy3 = new DummyWebElement();
            DummyWebElement    dummy4 = new DummyWebElement();
            DummyWebElement    dummy5 = new DummyWebElement();

            dummy1.FakeAttributeClass = "status";
            dummy2.FakeAttributeClass = "status";
            dummy3.FakeAttributeClass = "status";
            //dummy4.FakeAttributeClass = "status current";
            dummy4.FakeAttributeClass = "current";
            dummy5.FakeAttributeClass = "status";

            //dummy2.FakeAttributeClass = "num";
            //dummy3.FakeAttributeClass = "status";
            //dummy4.FakeAttributeClass = "status current";
            //dummy5.FakeAttributeClass = " unanswered";

            //this does not apply to IE, but does for Firefox and Chrome
            dummy1.FakeAttributeName  = "aria-label";
            dummy1.FakeAttributeValue = "Answered";
            dummy2.FakeAttributeName  = "aria-label";
            dummy2.FakeAttributeValue = "Answered";
            dummy3.FakeAttributeName  = "aria-label";
            dummy3.FakeAttributeValue = "Answered";
            dummy4.FakeAttributeName  = "aria-label";
            dummy4.FakeAttributeValue = "unanswered";
            dummy5.FakeAttributeName  = "aria-label";
            dummy5.FakeAttributeValue = "unanswered";
            //applies to all browsers
            dummy1.Text = "Answered";
            dummy2.Text = "Answered";
            dummy3.Text = "Answered";
            dummy4.Text = "Answered";
            dummy5.Text = "Answered";

            dummy1.FakeAttributeId = "aq_0";
            dummy2.FakeAttributeId = "aq_1";
            dummy3.FakeAttributeId = "aq_2";
            dummy4.FakeAttributeId = "aq_3";
            dummy5.FakeAttributeId = "aq_4";

            list = new List <IWebElement> {
                dummy1, dummy2, dummy3, dummy4, dummy5
            };

            webElements = new ReadOnlyCollection <IWebElement>(list.RandomSubset(numberOfElementsInListToBeReturned).ToList());

            return(webElements);
        }
Пример #20
0
 public override List<IWebElement> GetDummyElementsHeaderRows()
 {
     if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
     {
         if (DummyElementHeaderRowList == null)
         {
             DummyWebElement dummy1 = new DummyWebElement();
             dummy1.Text = "Test Name";
             DummyElementHeaderRowList = new List<IWebElement> { dummy1 };
         }
     }
     return DummyElementHeaderRowList;
 }
Пример #21
0
        private void SetSelectedStandardsGroupList()
        {
            ChildSelectedStandardsGroupList = new List <SelectedStandardsGroupLineItem>();
            try
            {
                //try waiting to find the list of VISIBLE elements for a specified amount of time
                SelectedStandardsItems.WaitUntilVisible(5);
            }
            catch (Exception e)
            {
                //if the list of elements are not found, then they are INVISIBLE, so IGNORE them by nulling the list
                Report.Write("element was not found");
                ChildSelectedStandardsGroupList = null;
            }
            //if the list is not null, then the list of VISIBLE elements were found
            if (ChildSelectedStandardsGroupList != null)
            {
                //wait to find EXISTING elements (should only be VISIBLE, but checks for INVISIBLE) for a specified amount of time
                ChildSelectedStandardsGroupWebElementList = SelectedStandardsItems.WaitForElements(5);
                if (Driver.GetType() == typeof(DummyDriver))
                {
                    DummyWebElement dummy1 = new DummyWebElement();
                    dummy1.FakeAttributeId    = "17714";
                    dummy1.FakeAttributeDocid = "49";
                    dummy1.FakeAttributeNk    = "ACT-Alg1-D.1";
                    dummy1.FakeCssValueClass  = "ContractedNode";
                    DummyWebElement dummy2 = new DummyWebElement();
                    dummy2.FakeAttributeId    = "17715";
                    dummy2.FakeAttributeDocid = "49";
                    dummy2.FakeAttributeNk    = "ACT-Alg1-D.2";
                    dummy2.FakeCssValueClass  = "ContractedNode";
                    List <IWebElement> list = new List <IWebElement> {
                        dummy1, dummy2
                    };
                    ChildSelectedStandardsGroupWebElementList = new ReadOnlyCollection <IWebElement>(list);
                }

                foreach (var webElement in ChildSelectedStandardsGroupWebElementList)
                {
                    int standardId = int.Parse(webElement.GetAttribute("id"));
                    //string clazz = webElement.GetCssValue("class");
                    string clazz = webElement.GetAttribute("class");
                    int    standardDocumentId = int.Parse(webElement.GetAttribute("docid"));
                    string standardName       = webElement.GetAttribute("nk");
                    Report.Write("ChildStandardsLineItemList by standardId: '" + standardId + "'; class: '" + clazz + "'; standardDocumentId: '" + standardDocumentId + "'; standardName: '" + standardName + "'.");
                    var standardsLineItem = new SelectedStandardsGroupLineItem(webElement, PageNames, standardId, clazz, standardDocumentId, standardName);
                    ChildSelectedStandardsGroupList.Add(standardsLineItem);
                }
            }
        }
 public virtual List <IWebElement> GetDummyElementsPaginationRows()
 {
     if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
     {
         if (DummyElementPaginationRowList == null)
         {
             DummyWebElement dummy1 = new DummyWebElement();
             dummy1.Text = @"
             <div style='float:right;'>
               <table>
                 <tbody>
                   <tr>
                     <td><a class='aspNetDisabled'><img src='/images/first.gif'>First</a></td>
                     <td><a class='aspNetDisabled'><img src='/images/previous.gif'>Prev</a></td>
                     <td><a href="">Next 25 <img src='/images/next.gif'></a></td>
                     <td><a href="">Last <img src='/images/last.gif'></a></td>
                   </tr>
                 </tbody>
               </table>
             </div>
             <div style='float:left;padding:3px;'>
               <strong>Results</strong> 1 - 25 of 1,000
             </div>
             ";
             DummyWebElement dummy2 = new DummyWebElement();
             dummy2.Text = @"
             <div style='float:right;'>
               <table>
                 <tbody>
                   <tr>
                     <td><a class='aspNetDisabled'><img src='/images/first.gif'>First</a></td>
                     <td><a class='aspNetDisabled'><img src='/images/previous.gif'>Prev</a></td>
                     <td><a href="">Next 25 <img src='/images/next.gif'></a></td>
                     <td><a href="">Last <img src='/images/last.gif'></a></td>
                   </tr>
                 </tbody>
               </table>
             </div>
             <div style='float:left;padding:3px;'>
               <select id=''><option value='10'>10</option></select>
             </div>
             ";
             DummyElementPaginationRowList = new List <IWebElement> {
                 dummy1, dummy2
             };
         }
     }
     return(DummyElementPaginationRowList);
 }
 /// <summary>
 /// Gets the Header Rows - Containing all the column names of the grid
 /// </summary>
 /// <returns></returns>
 public override List <IWebElement> GetDummyElementsHeaderRows()
 {
     if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
     {
         if (DummyElementHeaderRowList == null)
         {
             DummyWebElement dummy1 = new DummyWebElement();
             dummy1.Text = "<td class='TableHead'><a href='javascript:__doPostBack('ctl00$MainContent$ctl00$AdminControl$SnDataGridConfig$ctl01$Linkbutton1','')' class='CommandButton' id='ctl00_MainContent_ctl00_AdminControl_SnDataGridConfig_ctl01_Linkbutton1'><img alt='Add new element' src='/images/icon_add.gif'></a></td><td class='TableHead'>Name</td><td class='TableHead'>Value</td>";
             DummyElementHeaderRowList = new List <IWebElement> {
                 dummy1
             };
         }
     }
     return(DummyElementHeaderRowList);
 }
 /// <summary>
 /// Gets the Header Rows - Containing all the column names of the grid
 /// </summary>
 /// <returns></returns>
 public override List <IWebElement> GetDummyElementsHeaderRows()
 {
     if (Driver.GetType() == typeof(DummyDriver))
     {
         if (DummyElementHeaderRowList == null)
         {
             DummyWebElement dummy1 = new DummyWebElement();
             dummy1.Text = "Section";
             DummyElementHeaderRowList = new List <IWebElement> {
                 dummy1
             };
         }
     }
     return(DummyElementHeaderRowList);
 }
Пример #25
0
        public ReadOnlyCollection <IWebElement> GetDummyStepsToCompleteLabels()
        {
            ReadOnlyCollection <IWebElement> webElements = null;
            List <IWebElement> list   = new List <IWebElement>();
            DummyWebElement    dummy1 = new DummyWebElement();

            dummy1.Text      = ExpectedRequiredErrorsList[0];
            dummy1.Displayed = true;

            list = new List <IWebElement> {
                dummy1
            };
            webElements = new ReadOnlyCollection <IWebElement>(list);
            return(webElements);
        }
Пример #26
0
        /// <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++;
                }
            }
        }
        public virtual List <IWebElement> GetDummyElementsHeaderRows()
        {
            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                if (DummyElementHeaderRowList == null)
                {
                    DummyWebElement dummy1 = new DummyWebElement();
                    dummy1.Text = "<th>column 1</th><th>column 2</th><th>column 3</th>";

                    DummyElementHeaderRowList = new List <IWebElement> {
                        dummy1
                    };
                }
            }
            return(DummyElementHeaderRowList);
        }
Пример #28
0
        /// <summary>
        /// Gets the Header Rows - Containing all the column names of the grid
        /// </summary>
        /// <returns></returns>
        public override List <IWebElement> GetDummyElementsHeaderRows()
        {
            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                if (DummyElementHeaderRowList == null)
                {
                    DummyWebElement dummy1 = new DummyWebElement();
                    dummy1.Text = "<th>Test Name</th><th>Test Category</th><th>Subject</th><th>Grade Level</th><th>Start Date</th><th>End Date</th><th>Scores Due Date</th><th>Assignment Status</th>";

                    DummyElementHeaderRowList = new List <IWebElement> {
                        dummy1
                    };
                }
            }
            return(DummyElementHeaderRowList);
        }
        /// <summary>
        /// Gets the Header Rows - Containing all the column names of the grid
        /// </summary>
        /// <returns></returns>
        public override List <IWebElement> GetDummyElementsHeaderRows()
        {
            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                if (DummyElementHeaderRowList == null)
                {
                    DummyWebElement dummy1 = new DummyWebElement();
                    dummy1.Text = "<th>Test Name</th><th>End Date</th><th>Scores Due Date</th><th>Collection Status</th>";

                    DummyElementHeaderRowList = new List <IWebElement> {
                        dummy1
                    };
                }
            }
            return(DummyElementHeaderRowList);
        }
Пример #30
0
        /// <summary>
        /// Gets the Header Rows - Containing all the column names of the grid
        /// </summary>
        /// <returns></returns>
        public override List <IWebElement> GetDummyElementsHeaderRows()
        {
            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                if (DummyElementHeaderRowList == null)
                {
                    DummyWebElement dummy1 = new DummyWebElement();
                    dummy1.Text = "<th>Test Name</th><th># of Items</th><th>Test Stage</th><th>Modified Date</th>";

                    DummyElementHeaderRowList = new List <IWebElement> {
                        dummy1
                    };
                }
            }
            return(DummyElementHeaderRowList);
        }