string shareno = (geckoWebBrowser1.Document.GetElementById("shareno" + i).InnerHtml).Trim().Substring(6).ToString(); MessageBox.Show(train); // train.Trim().ToString(); if (trainno == train) { for(J=0;J<=11;J++) { MessageBox.Show("goning to select the class with the help of j loop"); Skybound.Gecko.GeckoElementCollection inputclick = geckoWebBrowser1.Document.GetElementsByTagName("input"); // GeckoInputElement inputclick = new GeckoInputElement(geckoWebBrowser1.Document.GetElementsByTagName("input")[0].DomObject); foreach(Skybound.Gecko.GeckoElement go in inputclick) { //MessageBox.Show("now going to click class and i am in foreach"); //MessageBox.Show("PARENT ID" + go.Parent.GetAttribute('id')); if (classs == "SL") { if (go.GetAttribute("type").Equals("radio") && go.GetAttribute("Name").Equals("classcode") && go.Parent.GetAttribute("id").Equals("sl" + i)) { // MessageBox.Show("inside if"); go.SetAttribute("checked", "checked"); break; } } else if (classs == "3A/C") { if (go.GetAttribute("type").Equals("radio") && go.GetAttribute("Name").Equals("classcode") && go.Parent.GetAttribute("id").Equals("a3" + i)) { // MessageBox.Show("inside if"); go.SetAttribute("checked", "checked"); // go.click(); // go.Focus(); break; } } else if (classs == "2A/C") { if (go.GetAttribute("type").Equals("radio") && go.GetAttribute("Name").Equals("classcode") && go.Parent.GetAttribute("id").Equals("a2" + i)) { // MessageBox.Show("inside if"); go.SetAttribute("checked", "checked"); // go.click(); // go.Focus(); break; } } else { MessageBox.Show("train not match with class"); } } break; } break; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)