/// <summary> /// the constructor /// </summary> /// <param name="webElement">IWebElement</param> /// <param name="key">the key, read from location url</param> /// <param name="index">the index</param> /// <param name="uniqueId">the unique ID</param> /// <param name="columnOnOff"></param> public CompletionStatisticLineItem(WebElementWrapper webElement, string key, int index, string uniqueId, CompletionStatisticConfiguration columnOnOff) : base() { ColumnConfiguration = columnOnOff; Key = key; UniqueId = uniqueId; Index = index; Location = new WebElementWrapper(ByLocation); }
/// <summary> /// Generate a list of item for the component on the grid /// </summary> private void SetCompletionStatisticList() { CompletionStatisticList = new List <CompletionStatisticLineItem>(); CompletionStatisticGrid.Wait(3); CompletionStatisticWebElementList = CompletionStatisticRows.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 }; CompletionStatisticWebElementList = new ReadOnlyCollection <IWebElement>(list); } int index = 0; ColumnConfig = new CompletionStatisticConfiguration(); ColumnConfig.Location = true; ColumnConfig.NumEligibleTesting = true; ColumnConfig.NumDataCollected = true; ColumnConfig.PercentDataCollected = true; ColumnConfig.CompletedOnline = true; ColumnConfig.CollectionStatus = true; foreach (var webElement in CompletionStatisticWebElementList) { Report.Write("Grid Row: " + webElement.Text); WebElementWrapper rowElementWrapper = new WebElementWrapper(ByCompletionStatisticRows); rowElementWrapper.WrappedElement = webElement; string locationLinkRefValue = GetLinkRefValue(rowElementWrapper, ByLocationColumn); string key = GetRowKey(locationLinkRefValue); string uniqueId = GetUniqueId(rowElementWrapper, ByCollectionStatusColumn); CompletionStatisticLineItem lineItem = new CompletionStatisticLineItem(rowElementWrapper, key, index, uniqueId, ColumnConfig); CompletionStatisticList.Add(lineItem); index++; } }