0

First, when the website is loaded into the webbrowser, I programmatically click on the login with the e-token button. The problem occurs after this stage. At this stage, this process takes 3-5 seconds as the information on the usb token device is read and the username on the token device is automatically entered in the username field on the website. So the username comes from e token, only the password is entered manually. But since my program clicks on the e-token login button first, then types the password , and then clicks the logmein button, it progresses very quickly and clicks the login button before the username isn't loaded. Before clicking the Logmein button, it is necessary to make sure that the username is uploaded to the website, otherwise I get an error. How can I overcome such a problem?

 private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
  webBrowser1.Document.GetElementById("etokenbutton").InvokeMember("click");
  webBrowser1.Document.GetElementById("pinedit").InnerText="mypassword";
  May I wait here five seconds?
  webBrowser1.Document.GetElementById("logmein").InvokeMember("click");
    }

0 Answers0