public Results SupplyUIStep(WebBrowser webBrowser, string login, string password) { if (webBrowser.Document == null) { return Results.Continue; } foreach (string id in errorObjectIDs) { HtmlElement error = webBrowser.Document.GetElementById(id); if (error != null) { if (error.IsVisible()) { return Results.Error; } } } HtmlElement link = webBrowser.GetFirstOf(UISupplier.expandLinkIDs); if (link != null) { link.MakeClick(); } HtmlElement pwd = webBrowser.GetFirstOf(UISupplier.passwordIDs); HtmlElement uid = webBrowser.GetFirstOf(UISupplier.usernameIDs); HtmlElement button = webBrowser.GetFirstOf(UISupplier.signInIDs); if (pwd != null && uid != null && button != null) { if(password != null) pwd.SetValue(password); if(login != null) uid.SetValue(login); button.MakeClick(); } return Results.Continue; }