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");
            }
        }
Exemplo n.º 4
0
        public void Verify_Validate_or_Change_SSID_Name()
        {
            //verify & Validate or Chnage SSIDs Name
            string Wifi2_4G = "", Wifi5G = "";

            Delay.Seconds(25);
            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            Ranorex.DivTag divTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_SSID']");
            //Report.Info(divTag.GetInnerHtml().ToString());
            foreach (Ranorex.InputTag inputTag in divTag.Find(".//input"))
            {
                Wifi2_4G = inputTag.Value.ToString();
                Report.Info("Wifi2_4G Name", Wifi2_4G);
            }

            Ranorex.DivTag divTag1 = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_SSID50']");
            //Report.Info(divTag1.GetInnerHtml().ToString());
            foreach (Ranorex.InputTag inputTag1 in divTag1.Find(".//input"))
            {
                Wifi5G = inputTag1.Value.ToString();
                Report.Info("Wifi5G Name", Wifi5G);
            }
            //compare SSIDs name,if both are same we need to change Wifi 5GHz SSID name before performing password validation
            if (Wifi2_4G == Wifi5G)
            {
                Report.Info("SSIDs names are same");
                // enable testcase to change the SSID name
                TestSuite.Current.GetTestCase("Change_WiFi5GHz_SSID_Name").Checked = true;
                repo.WebDocument19216801.SSID50.Value = Wifi5G + "_T";
            }
            else
            {
                Report.Info("SSIDs names are different");
            }
        }