Avatar of FVIAH
FVIAH
Flag for United States of America asked on

Automating an embedded browser

I have an embedded browser application that is in development to log users into known websites. I have the name and the password fields filling out ok, but I need to submit the form from there by either automatically clicking the submit button or having the application submit the form to continue.  Below is my current code. I tried converting the HTMLelement to a Button but it is not allowed.




        private void atgLoginButton_Click(object sender, EventArgs e)
        {

            HtmlDocument doc = webBrowser1.Document;

            HtmlElement nameElement = doc.GetElementById("tb");
            HtmlElement passElement = doc.GetElementById("tbxPass");
            HtmlElement buttonElement = doc.GetElementById("btnLogIn");

            nameElement.InnerText = "XXXXXX";
            passElement.InnerText = "XXXXXX";
 
        }
Microsoft Development.NET Programming

Avatar of undefined
Last Comment
FVIAH

8/22/2022 - Mon
Kamal Khaleefa

add a javascript code to do the click

example

doc.GetElementById("your button id").Click();
ASKER CERTIFIED SOLUTION
FVIAH

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
FVIAH

ASKER
Found solution
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23