0
HtmlDiv hd = new HtmlDiv (UINewTabWindowsInterneWindow); hd.SearchProperties.Add (HtmlDiv.PropertyNames.Id, "ContentPlaceHolder1_WebPartManager1_gwpucHorizontalAgentQueueGrid1_ucHorizontalAgentQueueGrid1_bottomWebPartHeaderMiddle1");코드화 된 그리드 요소를 트래버스하는 방법은 무엇입니까? 각 셀의 값을 가져 오는 동안 오류가 발생합니다.
HtmlControl htc1 = new HtmlControl(hd);
htc1.SearchProperties.Add(HtmlControl.PropertyNames.TagName, "TABLE");
UITestControlCollection collection = htc1.FindMatchingControls();
foreach (UITestControl uitabs in collection)
{
HtmlTable ht = (HtmlTable)uitabs;
UITestControlCollection temp1 ;
if (ht.Id == "ctl00_ContentPlaceHolder1_WebPartManager1_gwpucHorizontalAgentQueueGrid1_ucHorizontalAgentQueueGrid1_RadGrid1_ctl00")
{
HtmlControl htc_tr = new HtmlControl(ht);
htc_tr.SearchProperties.Add(HtmlControl.PropertyNames.TagName, "TR");
UITestControlCollection collection_tr = htc_tr.FindMatchingControls();
UITestControl tr;
for (int i = 0; i < collection_tr.Count; i++)
{
tr= collection_tr[i];
// HtmlRow hr = (HtmlRow)tr; //getting error not able to cntrol htmlol to html row
아마도'tr'은'HtmlRow'를 자식 요소로 갖는'UIControl'입니다. 컨트롤 계층 구조에 대해 더 배우려면'TestContext.WriteLine (tr.GetType(). ToString());'과 같은 것을 시도 할 것입니다. – AdrianHHH