public void Logout()
 {
     try
     {
         Actions action = new Actions(driver);
         action.MoveToElement(driver.FindElement(headerMenuUserRole)).Perform();
         driver.WaitForPageLoad(TimeSpan.FromSeconds(5));
         driver.ClickElementUsingWebElement(logout, "Logout");
         this.TESTREPORT.LogInfo("Logout is Success");
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("Logout is not success", EngineSetup.GetScreenShotPath());
     }
 }
Example #2
0
        public bool AccountingListPage()
        {
            bool isValid = false;

            try
            {
                driver.FindElement(setUpObject).Click();
                driver.WaitElementPresent(setupManager);
                driver.ClickElementUsingWebElement(accountingObject, accountingConst);
                driver.ClickElementUsingWebElement(accountingListObject, accountingListTitle);
                driver.WaitForPageLoad(TimeSpan.FromSeconds(50));
                driver.SwitchTo().Frame(1);
                isValid = driver.CheckElementExists(exportCSVButton, exportCSVConst);
            }
            catch (Exception ex)
            {
                this.TESTREPORT.LogFailure("Error in Accounting List Page: ", EngineSetup.GetScreenShotPath());
            }

            return(isValid);
        }
 /// <summary>
 /// Method to verify Paypal screen
 /// </summary>
 /// <param name="merchantName"></param>
 /// <param name="totalPrice"></param>
 public void verifyPayPalScreen()
 {
     try
     {
         driver.sleepTime(10000);
         WaitTillElementExists(lnkCancelLink);
         if (!driver.IsElementPresent(btnContinue))
         {
             driver.SwitchToFrameByLocator(framePaypalLogin);
             driver.CheckElementExists(txtEmail, "Email");
             driver.CheckElementExists(txtPassword, "Password");
             driver.CheckElementExists(btnLogin, "Login");
             driver.SwitchToDefaultFrame();
             driver.ScrollToPageBottom();
             driver.CheckElementExists(lnkCancelLink, "PayPal Cancel link");
         }
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("verifyPayPalScreen", "Failed to verify the PayPal screen", EngineSetup.GetScreenShotPath());
     }
 }
Example #4
0
 /// <summary>
 /// Method to validate Thank You Page
 /// </summary>
 public void validateThankYouPage(string amount = "")
 {
     try
     {
         driver.WaitForElement(lblThankYou, TimeSpan.FromSeconds(60));
         //driver.CheckElementExists(lblThankYou, "THANK YOU!");
         driver.CheckElementExists(btnPrintReceipt, "PRINT RECEIPT");
         if (amount != "")
         {
             driver.VerifyTextValue(lblDonationAmount, amount, "Donation Amount");
         }
         //driver.CheckElementExists(lblHTMLReceipt, "HTML Receipt");
         driver.WaitForPageLoad(TimeSpan.FromSeconds(60));
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("validateThankYouPage", "Error occurred while validating Thank You page", EngineSetup.GetScreenShotPath());
     }
 }
Example #5
0
 /// <summary>
 /// Method to validate User Transaction API
 /// </summary>
 public void validateUserTransaction(string transactionDate, string constituentId = "", string amount = "", string transactionId = "", string creditCardNumber = "", string creditCardType = "", string billingFirstName = "", string billinglastName = "", string street1Address = "", string city = "", string state = "", string country = "", string postalCode = "", string transactionType = "")
 {
     try
     {
         VerifyUserTransaction(transactionDate, constituentId, amount, transactionId, creditCardNumber, creditCardType, billingFirstName, billinglastName, street1Address, city, state, country, postalCode, transactionType);
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("validateUserTransaction", "Error occurred while validating User Transaction using LO API", EngineSetup.GetScreenShotPath());
     }
 }
 /// <summary>
 /// Method to verify Paypal error page
 /// </summary>
 public void verifyPayPalErrorScreen()
 {
     try
     {
         driver.CheckElementExists(imgLogo, "Make A Wish image Logo");
         driver.VerifyTextValue(lblPayPalError, "PayPal Error", "Paypal Error");
         driver.CheckElementExists(lnkTryAgain, "Please Try Again");
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("verifyPayPalScreen", "Failed to verify the PayPal screen", EngineSetup.GetScreenShotPath());
     }
 }
Example #7
0
 public void NavigateToLoginPage(String url)
 {
     try
     {
         driver.Navigate().GoToUrl(url);
         this.TESTREPORT.LogSuccess("NavigateToLogin", String.Format("Navigated to url: <mark>{0}</mark> successfully", url));
         driver.CheckElementExists(loginIn, "Log In");
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("NavigateToLogin", "Failed to navigate to url:" + url, EngineSetup.GetScreenShotPath());
     }
 }
 /// <summary>
 /// Method to click clear form and start over
 /// </summary>
 public void ClickClearformandstartoverbutton()
 {
     try
     {
         driver.ScrollToPageBottom();
         driver.ClickElement(btnClearFormAndStartOver, "Clearformandstartoverbutton");
         driver.WaitForPageLoad(TimeSpan.FromSeconds(60));
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("ClickClearformandstartoverbutton", "Failed to Clearformandstartover", EngineSetup.GetScreenShotPath());
     }
 }
Example #9
0
 /// <summary>
 /// Method to navigate to Donation page
 /// </summary>
 /// <param name="url"></param>
 public void navigateToDonationPage(string url)
 {
     try
     {
         NavigateToHome(url);
         if (!driver.Url.Contains("wishdev"))
         {
             driver.ClickElement(btnDonate, "Donate");
         }
         driver.WaitForPageLoad(TimeSpan.FromSeconds(60));
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("NavigateToDonationPage", "Error occurred while navigating to donation page", EngineSetup.GetScreenShotPath());
     }
 }
Example #10
0
 /// <summary>
 /// Method to navigate to home page
 /// </summary>
 /// <param name="url"></param>
 public void NavigateToHome(string url)
 {
     try
     {
         driver.Navigate().GoToUrl(url);
         if (driver.isAlertPresent())
         {
             IAlert devAlert = driver.SwitchTo().Alert();
             devAlert.SendKeys("testdev");
             devAlert.Accept();
         }
         driver.sleepTime(2000);
         this.TESTREPORT.LogSuccess("NavigateToHome", String.Format("Navigated to url: <mark>{0}</mark> successfully", url));
         driver.CheckElementExists(btnDonate, "DONATE");
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("NavigateToHome", "Failed to navigate to url:" + url, EngineSetup.GetScreenShotPath());
     }
 }
Example #11
0
        /// <summary>
        /// Method to validate home page controls
        /// </summary>
        /// <param name="chapterName"></param>
        public bool validateHomePageControls(string chapterName = "")
        {
            bool isValid = false;

            try
            {
                isValid  = driver.CheckElementNotDisplayed(lnkWishes, "WISHES");
                isValid &= driver.CheckElementDoesnotExists(lnkAboutUs, "ABOUT US");
                isValid &= driver.CheckElementDoesnotExists(lnkReferAChild, "REFER A CHILD");
                isValid &= driver.CheckElementDoesnotExists(lnkWaysToHelp, "WAYS TO HELP");
                isValid &= driver.CheckElementDoesnotExists(imgMakeAWish, "MAKE A WISH LOGO");
                isValid &= driver.CheckElementDoesnotExists(txtSearch, "Search");
                isValid &= driver.CheckElementDoesnotExists(btnDonate, "DONATE");

                if (chapterName != "")
                {
                    driver.CheckElementExists(By.XPath("//img[@alt='" + chapterName + "']"), "Chapter:" + chapterName);
                }
                else
                {
                    driver.CheckElementExists(lnkLocalChapters, "LOCAL CHAPTERS"); //Only for America
                }
            }

            catch (Exception ex)
            {
                this.TESTREPORT.LogFailure("ValidateHomePageControls", "Error occurred while validating elements on home page", EngineSetup.GetScreenShotPath());
            }
            return(isValid);
        }
 public void EnterLoginCredentialsNavigateToHomePage(String usrname, String pswd)
 {
     try
     {
         driver.FindElement(username).SendKeys(usrname);
         driver.FindElement(password).SendKeys(pswd);
         driver.FindElement(loginIn).Click();
         driver.WaitForPageLoad(TimeSpan.FromSeconds(30));
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("Enter Login Credentials and verify the Home Page", "Failed to enter the credentials or Home page Verification", EngineSetup.GetScreenShotPath());
     }
 }
Example #13
0
        /// <summary>
        /// Method to validate paypal transaction
        /// </summary>
        /// <param name="emailId">EMail id</param>
        /// <param name="password">Password</param>
        public void validatePaypalTransaction(string emailId, string password)
        {
            try
            {
                driver.sleepTime(10000);
                if (driver.IsElementPresent(framePaypalLogin))
                {
                    driver.SwitchToFrameByLocator(framePaypalLogin);
                    driver.SendKeysToElement(txtEmail, emailId, "Email");
                    driver.SendKeysToElement(txtPassword, password, "Email");
                    driver.ClickElement(btnLogin, "Login");
                    driver.SwitchToDefaultFrame();
                    driver.sleepTime(10000);
                }

                driver.WaitForPageLoad(TimeSpan.FromSeconds(30));
                driver.WaitElementExistsAndVisible(btnContinue);
                driver.CheckElementExists(lnkCancelLink, "Cancel");
                driver.ClickElement(btnContinue, "Continue");

                if (driver.isAlertPresent())
                {
                    IAlert devAlert = driver.SwitchTo().Alert();
                    devAlert.SendKeys("testdev");
                    devAlert.Accept();
                }
                driver.WaitForPageLoad(TimeSpan.FromSeconds(60));
            }
            catch (Exception ex)
            {
                this.TESTREPORT.LogFailure("validatePaypalTransaction", "Failed to validate Paypal transaction", EngineSetup.GetScreenShotPath());
            }
        }
Example #14
0
 /// <summary>
 /// Method to cancel paypal transaction
 /// </summary>
 public void cancelPaypalTransaction()
 {
     try
     {
         driver.ScrollPage();
         driver.ClickElement(lnkCancelLink, "PayPal Cancel Link");
         if (driver.isAlertPresent())
         {
             IAlert devAlert = driver.SwitchTo().Alert();
             devAlert.SendKeys("testdev");
             devAlert.Accept();
         }
         driver.WaitForPageLoad(TimeSpan.FromSeconds(60));
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("cancelPaypalTransaction", "Failed to cancel Paypal transaction", EngineSetup.GetScreenShotPath());
     }
 }
 /// <summary>
 /// Method to verify YOUR INFORMATION field errors
 /// </summary>
 public void verifyYourInformationFieldErrors()
 {
     try
     {
         driver.ScrollPage();
         driver.ValidateRequiredFieldError(txtFirstName, "First Name", "class", "input-error");
         driver.ValidateRequiredFieldError(txtLastName, "Last Number", "class", "input-error");
         driver.ValidateRequiredFieldError(txtEmailAddress, "Email Address", "class", "input-error");
         driver.ValidateRequiredFieldError(txtStreetAddress1, "Street Address 1", "class", "input-error");
         driver.ValidateRequiredFieldError(txtPostalCode, "Postal Code", "class", "input-error");
         driver.ScrollPage();
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("verifyYourInformationFieldErrors", "Failed to verify the Required field errors for YourInformation fields", EngineSetup.GetScreenShotPath());
     }
 }
 /// <summary>
 /// Validate donation amount
 /// </summary>
 /// <param name="amount"></param>
 public void validateDonationAmount(string amount)
 {
     try
     {
         driver.VerifyTextValue(lblDonationAmount, amount, "Donation Amount");
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("validateDonationAmount", "Failed to validate single donation amount", EngineSetup.GetScreenShotPath());
     }
 }
 /// <summary>
 /// Method to validate Billing Information required field errors
 /// </summary>
 public void VerifyBillingSectionFieldsErrors()
 {
     try
     {
         driver.WaitForPageLoad(TimeSpan.FromSeconds(30));
         driver.ValidateRequiredFieldError(txtCreditCardNumber, "Credit Card", "class", "input-error");
         driver.ValidateRequiredFieldError(listExpirationMonth, "Expiration Month", "class", "input-error");
         driver.ValidateRequiredFieldError(listExpirationYear, "Expiration Year", "class", "input-error");
         driver.ValidateRequiredFieldError(txtCvv, "CVV", "class", "input-error");
         driver.ScrollPage();
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("verifyBillingSectionFieldsErrors", "Failed to verify the error Highlight of YourInformation", EngineSetup.GetScreenShotPath());
     }
 }
 /// <summary>
 /// Method to Validate Benefitting chapter name
 /// </summary>
 /// <param name="name"></param>
 public void validateBenefittingChapter(string name)
 {
     try
     {
         driver.VerifyTextValue(lblDonorBenifitting, name, "Benefitting Chapter");
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("validateBenefittingChapter", "Failed to validate donor benefitting chapter name", EngineSetup.GetScreenShotPath());
     }
 }
 /// <summary>
 /// Validate donation review page controls
 /// </summary>
 public void validateDonationReviewPageControls()
 {
     try
     {
         driver.CheckElementExists(lblDonationDuration, "Donation Duration");
         driver.CheckElementExists(lblDonationAmount, "Donation Amount");
         driver.VerifyTextValue(lblDonationAmount, "$100", "Donation Amount");
         driver.CheckElementExists(lblDonorBenifitting, "Donation Benifitting");
         driver.VerifyTextValue(lblDonorBenifitting, "Make-A-Wish® America", "Benefitting");
         driver.CheckElementExists(btnReviewEdit, "REVIEW/EDIT button");
         driver.ScrollPage();
         driver.CheckElementExists(txtFirstName, "First Name");
         driver.CheckElementExists(txtLastName, "Last Name");
         driver.CheckElementExists(chkDonateOnBehalfOfCommpany, "Donate on behalf of company");
         driver.ClickElement(chkDonateOnBehalfOfCommpany, "Donate on behalf of company");
         driver.CheckElementExists(txtCompanyName, "Company Name");
         driver.CheckElementExists(txtEmailAddress, "Email Address");
         driver.CheckElementExists(txtStreetAddress1, "Street Address 1");
         driver.CheckElementExists(txtStreetAddress2, "Street Address 2");
         driver.CheckElementExists(txtPostalCode, "Postal Code");
         driver.ScrollPage();
         driver.CheckElementExists(rbtnCreditCard, "Credit Card");
         driver.CheckElementExists(rbtnPayPal, "Paypal");
         driver.CheckElementExists(txtCreditCardNumber, "Credit Card Number");
         driver.ScrollPage();
         driver.CheckElementExists(imgVisa, "Visa");
         driver.CheckElementExists(imgMasterCard, "Master Card");
         driver.CheckElementExists(imgAmericanExpress, "American Express");
         driver.CheckElementExists(imgDiscover, "Discover");
         driver.CheckElementExists(listExpirationMonth, "Expiration Month");
         driver.CheckElementExists(listExpirationYear, "Expiration Year");
         driver.CheckElementExists(txtCvv, "CVV");
         driver.CheckElementExists(btnSubmitDonation, "Submit Donation");
         driver.CheckElementExists(btnClearFormAndStartOver, "Clear form and start over");
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("ValidateDonationReviewPageControls", "Failed to validate controls on Donation review page", EngineSetup.GetScreenShotPath());
     }
 }
 /// <summary>
 /// Method to review/edit donation information
 /// </summary>
 public void reviewAndEditDonationInformation()
 {
     try
     {
         driver.ClickElement(btnReviewEdit, "Review/Edit button");
         driver.WaitForPageLoad(TimeSpan.FromSeconds(60));
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("reviewAndEditDonationInformation", "Failed to click review/edit button", EngineSetup.GetScreenShotPath());
     }
 }
        /// <summary>
        /// if an error has occurred, try to complete the current function so the test can continue
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="func"></param>
        /// <param name="defaultTimeout"></param>
        /// <param name="logMsg"></param>
        /// <returns></returns>
        internal static T CompleteAction <T>(Func <T> func, int defaultTimeout, IWebDriver _driver, string logMsg = null, string stepName = "")
        {
            bool errorHasOccurred = false;
            var  begin            = DateTime.UtcNow;

            while (true)
            {
                try
                {
                    if (errorHasOccurred && activeContext != null)
                    {
                        activeDriver.SwitchTo().DefaultContent();
                        if (activeContext is string)
                        {
                            //activeDriver.SwitchTo().Frame((dynamic)activeContext);
                            activeDriver.SwitchTo().Frame((string)activeContext);
                        }
                        else if (activeContext is int)
                        {
                            activeDriver.SwitchTo().Frame((int)activeContext);
                        }
                        else if (activeContext is By)
                        {
                            activeDriver.SwitchTo().Frame(activeDriver.FindElement((By)activeContext));
                        }
                    }
                    var returnObj = func.Invoke();
                    if (!String.IsNullOrEmpty(logMsg))
                    {
                        if (stepName != "")
                        {
                            testReport.LogSuccess(stepName, logMsg);
                        }
                        else
                        {
                            testReport.LogSuccess("UI Action", logMsg);
                        }
                    }
                    return(returnObj);
                }

                catch (Exception ex)
                {
                    errorHasOccurred = true;
                    if ((DateTime.UtcNow - begin).TotalSeconds >= defaultTimeout)
                    {
                        //we should check kdashboard_EditProfileButtonind of exception it is ...currently, I am doing temp fix
                        if (ex.StackTrace.Contains("UnpackAndThrowOnError") ||
                            ex.Message.Contains("Timed out waiting for page to load.") ||
                            ex.Message.Contains("The HTTP request") ||
                            ex.Message.Contains("timed out after 60 seconds") ||
                            ex.Message.Contains("Element is obscured"))
                        {
                            testReport.LogWarning("UI Action", String.Format("From IgnoredException: Exception Type - {0}, Error: {1} StackTrace: {2}", ex.GetType(), ex.Message, ex.StackTrace), EngineSetup.GetScreenShotPath());
                            Thread.Sleep(5000);
                            errorHasOccurred = false;
                            throw;
                        }
                        else
                        {
                            testReport.LogException(ex, EngineSetup.GetScreenShotPath());
                            throw;
                        }
                    }
                    //maybe do an else if here for situations in which the time didnt take longer than the timeout, but a longer time than expected
                    System.Threading.Thread.Sleep(100);
                }
            }
        }
 /// <summary>
 /// Method to update YOUR INFORMATION section
 /// </summary>
 /// <param name="firstName"></param>
 /// <param name="lastName"></param>
 /// <param name="emailAddress"></param>
 /// <param name="streetAddress1"></param>
 /// <param name="postalCode"></param>
 /// <param name="streetAddress2"></param>
 public void updateYourInformation(string firstName, string lastName, string emailAddress, string streetAddress1, string postalCode, string streetAddress2 = "")
 {
     try
     {
         driver.ScrollPage();
         driver.SendKeysToElement(txtFirstName, firstName, "First Name");
         driver.SendKeysToElement(txtLastName, lastName, "Last Name");
         driver.SendKeysToElement(txtEmailAddress, emailAddress, "Email Address");
         driver.SendKeysToElement(txtStreetAddress1, streetAddress1, "Street Address 1");
         driver.SendKeysToElement(txtStreetAddress2, streetAddress2, "Street Address 2");
         driver.SendKeysToElement(txtPostalCode, postalCode, "Postal Code");
         driver.ScrollPage();
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("updateYourInformation", "Failed to update YOUR INFORMATION section", EngineSetup.GetScreenShotPath());
     }
 }
 public void RoleSelection(string roleName)
 {
     try
     {
         //this.TESTREPORT.LogInfo("Selecting the Corresponding ROLE :  ", roleName.ToString());
         driver.FindElement(headerMenuUserRole).Click();
         driver.WaitElementExistsAndVisible(mawController);
         driver.FindElement(mawController).Click();
         driver.WaitForPageLoad(TimeSpan.FromSeconds(20));
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("Role Selection Failed : ", "Failed to navigate to Role :", EngineSetup.GetScreenShotPath());
     }
 }
 /// <summary>
 /// Method to update BILLING INFORMATION section
 /// </summary>
 /// <param name="paymentType"></param>
 /// <param name="creditCardNumber"></param>
 /// <param name="expirationMonth"></param>
 /// <param name="expirationYear"></param>
 /// <param name="cvv"></param>
 public void updateBillingInformation(string paymentType, string creditCardNumber = "", string expirationMonth = "", string expirationYear = "", string cvv = "")
 {
     try
     {
         if (paymentType == "CREDIT CARD")
         {
             driver.ScrollPage();
             driver.ClickElement(rbtnCreditCard, "CREDIT CARD");
             driver.SendKeysToElement(txtCreditCardNumber, creditCardNumber, "Credit Card Number");
             driver.SelectDropdownItemByText(listExpirationMonth, expirationMonth, "Expiration Month");
             driver.SelectDropdownItemByText(listExpirationYear, expirationYear, "Expiration Year");
             driver.SendKeysToElement(txtCvv, cvv, "CVV number");
         }
         else
         {
             driver.ScrollPage();
             driver.ClickElement(rbtnPayPal, "PAYPAL");
         }
         driver.ScrollPage();
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("updateBillingInformation", "Failed to update billing information section", EngineSetup.GetScreenShotPath());
     }
 }
Example #25
0
 public void AdditionalAuthentication()
 {
     try
     {
         string question = driver.FindElement(additionalAuthenticationQuestion).Text;
         if (question.Contains(additionalAuthenticationFirstQuestion))
         {
             driver.FindElement(additionalAuthenticationAnswer).SendKeys(additionalAuthenticationFirstQuestionAnswerValue);
             driver.FindElement(additionalAuthenticationSubmit).Click();
             driver.WaitForPageLoad(TimeSpan.FromSeconds(60));
             driver.CheckElementExists(homepageverification, feedbackElementInHomePage);
             this.TESTREPORT.LogSuccess("Additional Authentication ", "Navigation of Additional Authentication is success");
         }
         else
         if (question.Contains(additionalAuthenticationSecondQuestion))
         {
             driver.FindElement(additionalAuthenticationAnswer).SendKeys(additionalAuthenticationSecondQuestionAnswerValue);
             driver.FindElement(additionalAuthenticationSubmit).Click();
             driver.WaitForPageLoad(TimeSpan.FromSeconds(60));
             driver.CheckElementExists(homepageverification, feedbackElementInHomePage);
             this.TESTREPORT.LogSuccess("Additional Authentication ", "Navigation of Additional Authentication is success");
         }
         else
         if (question.Contains(additionalAuthenticationThirdQuestion))
         {
             driver.FindElement(additionalAuthenticationAnswer).SendKeys(additionalAuthenticationThirdQuestionAnswerValue);
             driver.FindElement(additionalAuthenticationSubmit).Click();
             driver.WaitForPageLoad(TimeSpan.FromSeconds(60));
             driver.CheckElementExists(homepageverification, feedbackElementInHomePage);
             this.TESTREPORT.LogSuccess("Additional Authentication ", "Navigation of Additional Authentication is success");
         }
     }catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("Additional Authentication Page", "You have entered an invalid security answer. Please try again." + EngineSetup.GetScreenShotPath());
     }
 }
 /// <summary>
 /// Method to submit donation
 /// </summary>
 public void submitDonation()
 {
     try
     {
         driver.ScrollToPageBottom();
         driver.ClickElement(btnSubmitDonation, "SUBMIT DONATION");
         if (driver.isAlertPresent())
         {
             IAlert devAlert = driver.SwitchTo().Alert();
             devAlert.SendKeys("testdev");
             devAlert.Accept();
         }
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("submitDonation", "Failed to submit donation", EngineSetup.GetScreenShotPath());
     }
 }
Example #27
0
 /// <summary>
 /// Method to validate Refund Transaction API
 /// </summary>
 public void validateRefundTransaction(string transactionDate, string transactionId = "", string constituentId = "")
 {
     try
     {
         RefundTransaction(transactionDate, transactionId, constituentId);
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("validateRefundTransaction", "Error occurred while validating RefundTransaction using LO API", EngineSetup.GetScreenShotPath());
     }
 }
 /// <summary>
 /// Method to verify invalid credit card number
 /// </summary>
 public void verifyErrorCreditCardNumber()
 {
     try
     {
         driver.WaitForPageLoad(TimeSpan.FromSeconds(60));
         driver.ValidateRequiredFieldError(txtCreditCardNumber, "Credit Card Number", "class", "input-error");
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("verifyErrorCreditCardNumber", "Failed to verify the error Highlight of CreditCardNumber", EngineSetup.GetScreenShotPath());
     }
 }
Example #29
0
        /// <summary>
        /// Method to validate user transaction and refund
        /// </summary>
        /// <param name="transactionType"></param>
        public void validateUserTransactionAndRefund(string transactionType = "", string amount = "")
        {
            try
            {
                string transactionId = getTransactionId();

                if (transactionId != "")
                {
                    if (transactionType != "")
                    {
                        VerifyUserTransaction("", "", "", transactionId, "", "", "", "", "", "", "", "", "", transactionType);
                    }
                    else if (amount != "")
                    {
                        VerifyUserTransaction("", "", amount, transactionId);
                    }
                    else
                    {
                        VerifyUserTransaction("", "", "", transactionId);
                    }

                    RefundTransaction("", transactionId, "");
                }
                else
                {
                    this.TESTREPORT.LogFailure("validateUserTransactionAndRefund", "Error occurred while validating transaction! Transaction id not found", EngineSetup.GetScreenShotPath());
                }
            }
            catch (Exception ex)
            {
                this.TESTREPORT.LogFailure("validateUserTransactionAndRefund", "Error occurred while validating user transaction & refund", EngineSetup.GetScreenShotPath());
            }
        }
 public void CustomSegmentsRegionValue()
 {
     try
     {
         driver.SwitchTo().Frame(1);
         this.TESTREPORT.LogInfo("Entered into Custom Segments - REGION Page");
         driver.ClickElementUsingWebElement(regionLabel, regionConst);
         driver.WaitForPageLoad(TimeSpan.FromSeconds(8));
         driver.CheckElementExists(regionLabelInRegionPage, regionConst);
         driver.CheckElementExists(customRecordTypeInRegionPage, regionConst);
         driver.ScrollPage();
         driver.ScrollPage();
         driver.CheckElementExists(southWestElement, southWestConst);
         driver.CheckElementExists(northernNevadaChapterElement, northernNevadaChapterConst);
         driver.SwitchTo().DefaultContent();
         driver.ClickElementUsingWebElement(customSegments, cusSegmentConst);
     }
     catch (Exception ex)
     {
         this.TESTREPORT.LogFailure("Navigation to Custom Segment- REGION Page is not success ", EngineSetup.GetScreenShotPath());
     }
 }