private void Button_Click(object sender, RoutedEventArgs e) { string user = username.Text; string pass = password.Password; rec = recemail.Text; var Page2 = new PaymentConfirmOTP(); var Page3 = new LoginOTP(); var ec = new EnterCredentials(); LibraryUtils.EmailLogin(user, pass); if (LibraryUtils.IsElementPresent(By.XPath("//span[contains(text(), 'Incorrect')]"))) { MessageBox.Show("Invalid sign-in details. Please try again"); } else if (LibraryUtils.IsElementPresent(By.XPath("//input[@id = 'otp']"))) { Page3.Show(); this.Close(); } else if (LibraryUtils.IsElementPresent(By.XPath("//span[text() = 'PAY']"))) { LibraryUtils.conBen(rec); LibraryUtils.money(); LibraryUtils.aftermoney(); this.Close(); } }
private void Button_Click(object sender, RoutedEventArgs e) { string otp = logOTP.Password; var Page2 = new PaymentConfirmOTP(); LibraryUtils.loginOTP(otp); if (LibraryUtils.IsElementPresent(By.XPath("//span[text() = 'PAY']"))) { LibraryUtils.conBen(EnterCredentials.rec); LibraryUtils.money(); } if (LibraryUtils.IsElementPresent(By.XPath("//span[text() = 'The amount exceeds your available balance']"))) { LibraryUtils.driver.Quit(); } else { LibraryUtils.conPay(); Page2.Show(); this.Close(); } }