Auto Click button/link on GoToMeeting

With GoToMeeting and Windows 7 there is a bug that it requires you to launch their software each time you start or join a meeting. I would like to automate clicking this link with a small app that I have started.  So when a user clicks a button in the app, it takes them to the gotomeeting page, and auto clicks on the "Launch Software" link. Any guidance would be appreciated.
I tried using the WebBrowser function, but haven't had luck.

Thanks!
Shaggy1Asked:
Who is Participating?
 
Rikin ShahConnect With a Mentor Microsoft Dynamics CRM ConsultantCommented:
try this if it works-
 
HtmlElement button = webBrowser1.Document.GetElementById("ButtonID");
if (button != null)
    button.InvokeMember("click");

Open in new window

0
 
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
I'm not sure if your program uses Windows.Forms, so this might not help at all. But, if you're using

System.Windows.Forms.WebBrowser to load your html form:
HtmlElement el = webBrowser1.Document.All["mybutton"];
object obj = el.DomElement;
System.Reflection.MethodInfo mi = obj.GetType().GetMethod("click");
mi.Invoke(obj, new object[0]);
or, if you're using mshtml:
HtmlElement el = webBrowser1.Document.All["mybutton"];
mshtml.HTMLInputElement el2 = (mshtml.HTMLInputElement)el.DomElement;
el2.click();

Hope this helps.
0
 
Shaggy1Author Commented:
Rikin,

Thanks for the help , appreciated. getting an error running this code: "Object Reference not set to an instance of an object" ...


 webBrowser1.AllowNavigation = true;
            webBrowser1.Navigate(targetURL);

            try
            {
                HtmlElement el = webBrowser1.Document.All["submit"];
                object obj = el.DomElement;
                System.Reflection.MethodInfo mi = obj.GetType().GetMethod("click");
                mi.Invoke(obj, new object[0]);              

            }

            catch (NullReferenceException  nre)
            {
                MessageBox.Show(nre.Message);
            }

Open in new window

0
 
Shaggy1Connect With a Mentor Author Commented:
Here is how i got it to work....

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {

            HtmlElementCollection links = webBrowser1.Document.GetElementsByTagName("a");
            foreach (HtmlElement link in links)
            {

                if (link.InnerText.Equals("Launch Software"))
                {
                    link.InvokeMember("click");
                }

            }          
                      
        }

Open in new window

0
 
Shaggy1Author Commented:
Both comments provided the working solution
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.