Exemplo n.º 1
0
        public void Validate_SorryThereWasAnErrorWhileUpdating()
        {
            /*
             * Report.Log(ReportLevel.Info, "Validation", "(Optional Action)\r\nValidating AttributeEqual (InnerText='Sorry! There was an error while updating your settings. Please try again a bit later.') on item 'WebDocumentIE.SorryThereWasAnErrorWhileUpdating'.", repo.WebDocumentIE.SorryThereWasAnErrorWhileUpdatingInfo);
             * Validate.Attribute(repo.WebDocumentIE.SorryThereWasAnErrorWhileUpdatingInfo, "InnerText", "Sorry! There was an error while updating your settings. Please try again a bit later.", Validate.DefaultMessage, false);
             */

            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            Ranorex.DivTag confirmWizardDivTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'confirm-wizard']");
//            /dom[@page='' and @path='/' and @browsername='IE' and @pageurl='http://192.168.0.1/?change_password&mid=ChangePassword']//div[#'confirm-wizard']
            // Div --> errClose-NewPassword13,errClose-CurrentPassword, errClose-ReenterPassword
            string confirmWizardPath = confirmWizardDivTag.GetPath().ToString();
//            Report.Info("confirmWizardPath : " + confirmWizardPath);
            IList <DivTag> confirmWizardDivTags = confirmWizardDivTag.Find <DivTag>(confirmWizardPath);
            int            rulesCount           = confirmWizardDivTags.Count;
//            Report.Info(rulesCount.ToString());
            string rst = "";

            if (rulesCount > 0)
            {
                foreach (var row in confirmWizardDivTags)
                {
                    IList <DivTag> cols = row.Find <DivTag>("./Div");
                    foreach (DivTag col in cols)
                    {
                        //IList<DivTag> spanVals = row.Find<DivTag>("./Div");
                        rst = col.InnerText;
                        Report.Info(rst);
                        Report.Screenshot();
                        Report.Screenshot(confirmWizardDivTag.Element, true);
                    }
                }
            }
            if (rst.StartsWith("Your settings have been updated"))
            {
                Report.Failure("Incorrect validation");
            }
            else if (rst.StartsWith("Sorry! There was an error while updating your settings. Please try again a bit later."))
            {
                //Sorry! There was an error while updating your settings. Please try again a bit later.
                Report.Success("Successful Validation");
            }
        }
        public void New_and_Current_Password_Validation()
        {
            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            Ranorex.DivTag confirmWizardDivTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'confirm-wizard']");
            string         confirmWizardPath   = confirmWizardDivTag.GetPath().ToString();
//            Report.Info("confirmWizardPath : " + confirmWizardPath);
            IList <DivTag> confirmWizardDivTags = confirmWizardDivTag.Find <DivTag>(confirmWizardPath);
            int            rulesCount           = confirmWizardDivTags.Count;
//            Report.Info(rulesCount.ToString());
            string rst = "";

            if (rulesCount > 0)
            {
                foreach (var row in confirmWizardDivTags)
                {
                    IList <DivTag> cols = row.Find <DivTag>("./Div");
                    foreach (DivTag col in cols)
                    {
                        //IList<DivTag> spanVals = row.Find<DivTag>("./Div");
                        rst = col.InnerText;
                        Report.Info(rst);
                        Report.Screenshot();
                        Report.Screenshot(confirmWizardDivTag.Element, true);
                    }
                }
            }
            if (rst.StartsWith("Your settings have been updated"))
            {
//				Report.Success("Successful Validation");
                Report.Failure("Incorrect validation");
            }
            else if (rst.StartsWith("Sorry! There was an error while updating your settings. Please try again a bit later."))
            {
                //Sorry! There was an error while updating your settings. Please try again a bit later.
//				Report.Failure("Incorrect validation");
                Report.Success("Successful Validation, New password cannot be  same as current password");
            }
        }
Exemplo n.º 3
0
        public void Validate_ConfirmWizard()
        {
            Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Id='confirm-wizard') on item 'WebDocumentIE.ConfirmWizard1.ConfirmWizard'.", repo.WebDocumentIE.ConfirmWizard1.ConfirmWizardInfo);
            Validate.Attribute(repo.WebDocumentIE.ConfirmWizard1.ConfirmWizardInfo, "Id", "confirm-wizard");

            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            Ranorex.DivTag confirmWizardDivTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'confirm-wizard']");
            string         confirmWizardPath   = confirmWizardDivTag.GetPath().ToString();
//            Report.Info("confirmWizardPath : " + confirmWizardPath);
            IList <DivTag> confirmWizardDivTags = confirmWizardDivTag.Find <DivTag>(confirmWizardPath);
            int            rulesCount           = confirmWizardDivTags.Count;
//            Report.Info(rulesCount.ToString());
            string rst = "";

            if (rulesCount > 0)
            {
                foreach (var row in confirmWizardDivTags)
                {
                    IList <DivTag> cols = row.Find <DivTag>("./Div");
                    foreach (DivTag col in cols)
                    {
                        //IList<DivTag> spanVals = row.Find<DivTag>("./Div");
                        rst = col.InnerText;
                        Report.Info(rst);
                    }
                }
            }
            if (rst.StartsWith("Your settings have been updated"))
            {
                Report.Failure("Incorrect validation");
            }
            else if (rst.StartsWith("Sorry! There was an error while updating your settings. Please try again a bit later."))
            {
                //Sorry! There was an error while updating your settings. Please try again a bit later.
                Report.Success("Successful Validation");
            }
        }