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
I would assume that something is getting muddled after all of the conversions you're doing. I've tried the following, and it should work for your scenario as well.
You may even be able to get away with performing whatever actions on your row you need to do without converting it from the UITestControl back to a row. Most properties and methods of the row are available in the parent class.