Hi, to give a gist of what i am trying to do is, I am launching a webpage,
once the page is launched and loaded, the page has a drop down,
I am trying to select a value, the value get selected but there is an onchange
event associated with it, which doesn't get fired. can anyone help me in how do i
fire that event, as upon firing of the event, there are other controls which get
enables. At present once the value in the drop down is selected, the other controls
do not get enabled.
InternetExplorer WebSiteURL = new InternetExplorer();
WebSiteURL.Navigate("example.com");
System.Threading.Thread.Sleep(5000);
HTMLDocument myDoc = new HTMLDocument();
WebSiteURL.Visible = true;
System.Threading.Thread.Sleep(5000);
myDoc = (HTMLDocument)WebSiteURL.Document;
System.Threading.Thread.Sleep(5000);
SHDocVw.WebBrowser webBrowser1 = new SHDocVw.WebBrowser();
HtmlElement theList = webBrowser1.Document.GetElementById("ST_SEARCH_TYPE");
if (myDoc != null)
{
var dropdown = ((IHTMLElement)myDoc.all.item("ST_SEARCH_TYPE"));
var dropdownItems = (IHTMLElementCollection)dropdown.children;
foreach (IHTMLElement option in dropdownItems)
{
var value = option.getAttribute("value").ToString();
if (value.Equals("P"))
option.setAttribute("selected", "selected");
}
}
This the html code.
-- Select --
PAN - New / Change Request
TAN - New / Change Request
What I have tried:
Have tried with invokescript but no luck.