How to make test failure to Pass
Posted: Fri May 16, 2014 10:07 am
Hi I have a scenario:
1. while adding a new user in my app
you enter all the details and register and
System will validate if user already exist or similar name already exist
If similar name exist you have choice either register anyway or modify user details and then register.
I created automation script for this to handle
//Special Case if similar names suggestions appear
if (IsElementVisible(repo.HomeArea.NotListed))
{
//Report.Log(ReportLevel.Info, "Validation", "clicked.", repo.HomeArea.NotListedInfo);
repo.HomeArea.NotListed.PerformClick();
Delay.Seconds(2);
}
// Check condition if User name suggested
public bool IsElementVisible(ButtonTag element)
{
bool condition = Validate.Attribute(element, "Visible", "True", null, false);
return condition;
}
Above code did the trick, but every time I run this test, Report Logs an Error if element is False.
Can somebody suggest me how to handle this situation? I do not want errors to appear if name suggestions doesn't come up. My programming skills are very basic so struggling
1. while adding a new user in my app
you enter all the details and register and
System will validate if user already exist or similar name already exist
If similar name exist you have choice either register anyway or modify user details and then register.
I created automation script for this to handle
//Special Case if similar names suggestions appear
if (IsElementVisible(repo.HomeArea.NotListed))
{
//Report.Log(ReportLevel.Info, "Validation", "clicked.", repo.HomeArea.NotListedInfo);
repo.HomeArea.NotListed.PerformClick();
Delay.Seconds(2);
}
// Check condition if User name suggested
public bool IsElementVisible(ButtonTag element)
{
bool condition = Validate.Attribute(element, "Visible", "True", null, false);
return condition;
}
Above code did the trick, but every time I run this test, Report Logs an Error if element is False.
Can somebody suggest me how to handle this situation? I do not want errors to appear if name suggestions doesn't come up. My programming skills are very basic so struggling