public void SetDomicile(string region, string country) { if (!IsDomicileCountrySet(country)) { WebDriverExtensions.WaitUntilClickable(Driver, _domicileSelector).Click(); WebDriverExtensions.WaitUntilVisible(Driver, _regionSelector).Click(); var regionSection = WebDriverExtensions.WaitUntilVisible(Driver, _regionSectionSelector); var regions = regionSection.FindElements(By.XPath("//li")); if (regions != null) { regions.FirstOrDefault(x => x.Text == region).Click(); } WebDriverExtensions.WaitUntilClickable(Driver, _domicileCountrySelector).Click(); var countrySection = WebDriverExtensions.WaitUntilVisible(Driver, _domicileCountrySectionSelector); var domicileCountrySection = countrySection.FindElements(By.XPath("//li")); if (domicileCountrySection != null) { domicileCountrySection.FirstOrDefault(x => x.Text == country).Click(); } } }
public void EnterClientDetails(string emailAddress, string password) { WaitForPageToLoad(); var emailAddressTextBox = WebDriverExtensions.WaitUntilClickable(Driver, _emailAddressLocator); WebDriverExtensions.FillTextbox(Driver, emailAddressTextBox, emailAddress); WebDriverExtensions.WaitUntilClickable(Driver, _emailNextBtnLocator).Click(); var pwdTextBox = WebDriverExtensions.WaitUntilVisible(Driver, _passwordLocator); pwdTextBox.Click(); WebDriverExtensions.FillTextbox(Driver, pwdTextBox, password); WebDriverExtensions.WaitUntilClickable(Driver, _passwordNextBtnLocator).Click(); }
public void EnterNewUserDetails(User user) { int i = 1; WaitForPageToLoad(); WebDriverExtensions.FillTextbox(Driver, _emailAddressElem, user.EmailAddress); WebDriverExtensions.FillTextbox(Driver, _pwdElem, user.Password); WebDriverExtensions.FillTextbox(Driver, _reEnterPwdElem, user.Password); if (user.QuestionAnswers.Count > 3) { throw new Exception("Input for the Questions/Answers did not match the UI"); } foreach (var questAndDict in user.QuestionAnswers) { WebDriverExtensions.WaitUntilClickable(Driver, By.Id($"selectSecurityQuestion{i}-button_text")).Click(); WebDriverExtensions.WaitUntilVisible(Driver, By.XPath($"//*[@id='selectSecurityQuestion{i}-menu']//li//*[text()='{questAndDict.Item1}']")).Click(); var answerElem = Driver.FindElement(By.Id($"securityQuestion{i}Answer")); WebDriverExtensions.FillTextbox(Driver, answerElem, questAndDict.Item2); i++; } }