Example #1
0
        /// <summary>
        /// Check error message is 'expectedErrorMsg'.
        /// </summary>
        /// <param name="expectedErrorMsg">expected error message.</param>
        /// <returns>is verify success</returns>
        public bool Check_ErrorMessage(string expectedErrorMsg)
        {
            var verifyErrorMsg = false;
            var hasErrorMsg    = WebElementKeeper.WaitingFor_ElementIsVisible(this.Driver, By.XPath(_errorMsgXPath));

            if (!hasErrorMsg && !txtErrorMsg.Displayed)
            {
                return(verifyErrorMsg);
            }

            verifyErrorMsg = WebElementKeeper.WaitingFor_TextToBePresentInElement(this.Driver, this.txtErrorMsg, expectedErrorMsg);
            return(verifyErrorMsg);
        }
Example #2
0
        public bool IsErrorMsgExpected(string expectedErrorMsg)
        {
            var isExpected = false;

            WebElementKeeper.WaitingFor_ElementIsVisible(this.Driver, By.XPath(_errorMsgXPath));
            if (!txtErrorMsg.Displayed)
            {
                return(isExpected);
            }

            isExpected = WebElementKeeper.WaitingFor_TextToBePresentInElement(this.Driver, this.txtErrorMsg, expectedErrorMsg);
            return(isExpected);
        }