I have sceanrio where the controls in page are dynamic & those controls are in table of the Web page. I have used the below code snippet for identfying objects. But i am having a problem of identfying object because the "id" we are using for identifying object is changing dynamically. For Example id is "attribute_2_3003_3128" when we scripted, but it is change now to atrribute_4_3003_3128. Every time the single digit number in between is changed. Rest of the ID remains same. Please let me know how can we solve this issue.
Browser
ie = Manager.ActiveBrowser;
FramesCollection f = ie.Frames;
Browser b = f.ById("RAD_SPLITTER_PANE_EXT_CONTENT_ContentRadPane");
HtmlTable mainTable = b.Find.ById<HtmlTable>("tblContainer");
HtmlTableRow tablerow = mainTable.Find.ById<HtmlTableRow>("tblRel");
HtmlTable table = tablerow.Find.ById<HtmlTable>("tblmain");
int count = table.BodyRows.Count;
string proddes = ((string)(System.Convert.ChangeType(Data["ProductDesc"], typeof(string))));
string enabled = ((string)System.Convert.ChangeType(Data["Enabled"], typeof(string)));
for (int i=1; i < count - 1; i++){
HtmlTableRow row = table.BodyRows[i];
HtmlTableCell cell = row.Cells[1];
if (cell.InnerText.Equals("Product Description")){
HtmlTableCell cell1 = row.Cells[3];
//Regex regex = new Regex("""[?0-9]{1}");
//Console.WriteLine(regex.ToString());
//Console.ReadLine();
HtmlInputText text = cell1.Find.ById<HtmlInputText>("attribute_2_3003_3128"
text.Text = proddes;
}
Regards,
Kalyan Uppalapati
Riversand Technologies.