/// <summary> /// get the question's line item /// </summary> /// <param name="choice">the question choice</param> /// <returns>the Droppable Line Item</returns> public DroppableLineItem GetQuestionLineItem(string choice) { DroppableLineItem droppableLineItem = null; foreach (var questionChoice in QuestionChoiceList) { if (questionChoice.ChoiceContent.Equals(choice)) { droppableLineItem = questionChoice; break; } } return(droppableLineItem); }
/// <summary> /// sets the question choice list /// </summary> public void SetQuestionChoiceList() { QuestionChoiceList = new List <DroppableLineItem>(); QuestionChoiceGrid.Wait(3); QuestionChoiceWebElementList = QuestionChoiceRows.WaitForElements(5); if (Driver.WrappedDriver.GetType() == typeof(DummyDriver)) { QuestionChoiceWebElementList = GetDummyIdentifiers(); } foreach (var webElement in QuestionChoiceWebElementList) { string key = webElement.GetAttribute("data-key"); string question = webElement.Text.Trim(); Report.Write("DroppableLineItem data-key: '" + key + "'; question: '" + question); var droppableLineItem = new DroppableLineItem(key, question); QuestionChoiceList.Add(droppableLineItem); } }