1

I know how to use

    Invokemember("Click")

to simulate clicking in web browser. But I cant find the c# code for simulating the selection and then clicking an option from a combo box in a specific URL. The selection can be done by:

    webBrowser1.Document.GetElementById("id").SetAttribute("value","option");

but this only changes the text of the combo box in the web page. It does not update the page based on the selected option in the combo box. And again

    Invokemember("Click")

does not do anything in this case. Thanks in advance.

Mike
  • 369
  • 5
  • 21
  • You need to use MSHTML Reference (using mshtml;), IHTMLDocument2 interface, InvokeMember("onchange") and then Invokemember("Click"). – user3806621 Aug 12 '14 at 13:47
  • Dear user3806621, I tried the solution you said. It works fine for updating the view of the webpage in webBrowser1. But The webBrowser1.DocumentText does not change and remains the same as it was before. How can I update the DocumentText too along with choosing an option from the combobox. Thanks – Mike Aug 13 '14 at 09:39
  • Can you provide your source code with more details? – user3806621 Aug 13 '14 at 13:24

0 Answers0