I am using TestNG and having one issue.
Test Case : I am checking validation message that if user leave email id blank & Click on Login , System should fire message "Please Enter Valid Email".
I am verifying this message using Selenium & Java.
Code Logic :
If(Dynamicmsg.equals("Please Enter Valid Email"))
{
System.out.println("Email validation working");
}
else
{
System.out.println("Email validation not working");
}
It works fine, When other message found, condition goes to else and print that Email validation not working.
But TestNG Report says :
Passed -1
What I want is I want to tell testNG that fail this test case in report as well if conditions do not match.
org.testng.Assert.fail("Email validation didn't work");