private void LogIn(IElementContainer browser) { browser.Link(Find.ByName("LoginLink")).Click(); browser.TextField(Find.ById("infoLDAP_E.customerID")).Value = Config.Username; browser.Form("formCustomerID_1").Submit(); if (browser.Elements.Count(el => el.Text == "We are unfamiliar with the computer you are using") != 0) { // Security Question var question = browser.Element(Find.ByText("Question:")).NextSibling.Text; question = question.TrimStart(' ').TrimEnd(' '); browser.TextField("cbQuestionChallenge.responseUser").Value = Config.SecurityAnswers[question]; browser.Element(Find.ByValue("Continue")).Click(); } browser.TextField("authentication.PassCode").Value = Config.Passcode; browser.TextField("authentication.ERN").Value = Config.RegistrationNumber; browser.Form(Find.ByName("hiddenForm")).Submit(); }