Open webbrowser, auto complete from components and submit

0
0

Hi, does Wisej have same function like VS webBrowse.Document.GetElementByID() like following, thanks a lot.

 

public Form1()
        {
            InitializeComponent();
            //navigate to you destination 
            webBrowser1.Navigate("https://www.certiport.com/portal/SSL/Login.aspx");
        }
        bool is_sec_page = false;
        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            if (!is_sec_page)
            {
                //get page element with id
                webBrowser1.Document.GetElementById("c_Username").InnerText = "username";
                webBrowser1.Document.GetElementById("c_Password").InnerText = "pass";
                //login in to account(fire a login button promagatelly)
                webBrowser1.Document.GetElementById("c_LoginBtn_c_CommandBtn").InvokeMember("click");
                is_sec_page = true;
            }
            //secound page(if correctly aotanticate
            else
            {
                //intract with sec page elements with theire ids and so on
            }

        }
  • You must to post comments
0
0

No. It’s impossible to handle inner elements in an iframe from a different origin. If the iframe (WebBrowser control) is from the same origin you ay be able to achieve what you want but it must be done on the client in javascript.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.