I am facing a pretty “small” problem (at least I thought so): I want to change the result of a test case regardless of how many test steps have failed in that test case. I can easily do the opposite with **
but I am yet to find a way to mark a test as passed and I did try
That dont solve my issue when there are steps that failed before
Hello @Dave_Evers thank you for your answer I am aware of these option, using these I would have to this for every single steps of my test cases. What am trying to achieve is to have an test case with two different condition of success one would be if no steps failed and the condition is verified → test passed and the second would be if the condition is verified the test is passed. If I set them all at optional It would solve my problem but create a new one.
@mamourwane It is hard to tell what the best solution for your question is without knowing more information. If there aren’t many steps that could fail you could put it into a try/catch block where the steps that might fail are in the try block and then the catch would have the conditional to check.
@mamourwane - as suggested by @bharathi.a is correct way
just you need to put
WebUI.verifyMatch(actual, expected, true, FailureHandling.OPTIONAL) where ever you are using verifymatch
if you want to pass test cases then Do not use FailureHandling.STOP_ON_FAILURE, FailureHandling.CONTINUE_ON_FAILURE in test steps.
If you want to make a direct match between the actual text and the expected text, then you should set the boolean to false in the above statement, not true. Setting the boolean to true sets the match to using Regular Expression (RegEx). Then you need to know what are the components that make up RegEx (wild cards, ignore spaces, ignore letter cases, etc.).