Ejemplo n.º 1
0
            /// <summary>
            /// Opens up the validation errors, and then closes it after verification.
            /// </summary>
            /// <param name="sf"></param>
            /// <param name="iconText"></param>
            /// <param name="messageName"></param>
            /// <param name="field"></param>
            /// <param name="jumpToLink"></param>
            /// <returns></returns>
            public bool VerifyRowValidationErrorExists(SmartFormPage sf, string iconText, string messageName, string field, string jumpToLink)
            {
                bool returnValue = false;

                sf.BtnHideShowErrors.Click();
                Web.PortalDriver.SwitchTo().Frame("validationErrors");
                // use the field name as the anchor
                Container FieldContainer    = new Container(By.XPath(".//td[text()='" + field + "']"));
                Container MessageContainer  = new Container(By.XPath(".//td[text()='" + field + "']/../td[2][text()='" + messageName + "']"));
                Container IconTextContainer = new Container(By.XPath(".//td[text()='" + field + "']/../td[1]/img[@title='" + iconText + "']"));
                Container JumpToContainer   = new Container(By.XPath("//.//td[text()='" + field + "']/../td[4]/a[text()='" + jumpToLink + "']"));

                if (FieldContainer.Exists && MessageContainer.Exists && IconTextContainer.Exists && JumpToContainer.Exists)
                {
                    returnValue = true;
                }
                return(returnValue);
            }
            /// <summary>
            /// Opens up the validation errors, and then closes it after verification.
            /// </summary>
            /// <param name="sf"></param>
            /// <param name="iconText"></param>
            /// <param name="messageName"></param>
            /// <param name="field"></param>
            /// <param name="jumpToLink"></param>
            /// <returns></returns>
            public bool VerifyRowValidationErrorExists(SmartFormPage sf, string iconText, string messageName, string field, string jumpToLink)
            {
                bool returnValue = false;
                sf.BtnHideShowErrors.Click();
                Web.PortalDriver.SwitchTo().Frame("validationErrors");
                // use the field name as the anchor
                Container FieldContainer = new Container(By.XPath(".//td[text()='" + field + "']"));
                Container MessageContainer = new Container(By.XPath(".//td[text()='" + field + "']/../td[2][text()='" + messageName + "']"));
                Container IconTextContainer = new Container(By.XPath(".//td[text()='" + field + "']/../td[1]/img[@title='"+ iconText +"']"));
                Container JumpToContainer = new Container(By.XPath("//.//td[text()='" + field + "']/../td[4]/a[text()='" + jumpToLink + "']"));

                if (FieldContainer.Exists && MessageContainer.Exists && IconTextContainer.Exists && JumpToContainer.Exists)
                {
                    returnValue = true;
                }
                return returnValue;
            }