public void ByContentLabelTest() { this.SchoolNet().LoadWebPage(); int index = 0; string uniqueId = "ctl01"; QuestionAnswerContent form = new QuestionAnswerContent("T", index, uniqueId, ContentType.AnswerChoice, ItemType.MultipleChoice); Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_RepeaterAnswers_" + uniqueId + "_txtAnswerLabel", form.ByContentLabel().ToString(), "ByContentLabel locator matches"); form = new QuestionAnswerContent("T", index, uniqueId, ContentType.AnswerChoice, ItemType.TrueFalse); Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_RepeaterAnswers_" + uniqueId + "_txtAnswerLabel", form.ByContentLabel().ToString(), "ByContentLabel locator matches"); form = new QuestionAnswerContent("T", index, uniqueId, ContentType.AnswerChoice, ItemType.InlineResponse); Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_RepeaterClozeStemAnswers_" + uniqueId + "_txtAnswerLabel", form.ByContentLabel().ToString(), "ByContentLabel locator matches"); form = new QuestionAnswerContent("T", index, uniqueId, ContentType.AnswerChoice, ItemType.DragAndDrop); Assert.AreEqual("By.CssSelector: .tab-pane.ng-scope.active .listChoices li[data-ng-repeat='tabChoice in tab.AllChoices']:nth-of-type(" + index + ") .AnswerLabel", form.ByContentLabel().ToString(), "ByContentLabel locator matches"); form = new QuestionAnswerContent("T", index, uniqueId, ContentType.AnswerChoice, ItemType.HotSpotSingleSelection); Assert.AreEqual("By.CssSelector: #tblAnswers tbody[ng-repeat='answer in TestItem.Answers']:nth-of-type(" + index + ") .AnswerLabel", form.ByContentLabel().ToString(), "ByContentLabel locator matches"); form = new QuestionAnswerContent("T", index, uniqueId, ContentType.AvailableChoice, ItemType.Matching); Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_choicesRepeator_" + uniqueId + "_txtChoiceLabel", form.ByContentLabel().ToString(), "ByContentLabel locator matches"); form = new QuestionAnswerContent("T", index, uniqueId, ContentType.AvailableChoice, ItemType.DragAndDrop); Assert.AreEqual("By.CssSelector: .listChoices li[data-ng-repeat='choice in TestItem.Choices']:nth-of-type(" + index + ") .AnswerLabel", form.ByContentLabel().ToString(), "ByContentLabel locator matches"); form = new QuestionAnswerContent("T", index, uniqueId, ContentType.QuestionStem, ItemType.TrueFalse); Assert.AreEqual("By.Id: ctl00_MainContent_EditTestItemControl_stemRepeator_" + uniqueId + "_txtStemLabel", form.ByContentLabel().ToString(), "ByContentLabel locator matches"); form = new QuestionAnswerContent("T", index, uniqueId, ContentType.TargetContainer, ItemType.TrueFalse); Assert.AreEqual("By.CssSelector: .listChoices li[data-ng-repeat='container in TestItem.Containers']:nth-of-type(" + index + ") .AnswerLabel", form.ByContentLabel().ToString(), "ByContentLabel locator matches"); }