How to know my testcases failed when assert failed

Hi all, I’m a newbie in UiPath, I used UiPath to test my SAP GUI. When I tried to assert the expected text the testcase result still failed even unmatch.
I used step status, then get failed step at a report. but test case was still passed.
In this case, how to make test case fail too? many thanks.

@Sabri_Hoang

Welcome to the community…

Use a verify activity which will set the test case to fail when verfication fails

Cheers

1 Like

@Sabri_Hoang

try the below activities

image

Regards

1 Like

Many thanks for your quick response.
I’m using Try/Catch then Throw activity to handle exception(not throw the exception popup)
but I still want to failed testcase instead of the passed status here.
Can I use Report Status in this case or Verify as you all mentioned above?

@Sabri_Hoang

Use verify activity and in throw you can set failed to a variable and set the variable to success in try block at the end and in verify expression you can verify if the string variable is success …if its not success the verification will fail and test case will be failed

Cheers

@Sabri_Hoang

Use the verify activities and if the output and the expected data or not same then the test case will be failed.

Regards

1 Like

great, I see an idea now. thanks for your help!

1 Like

ok, I see now. I will try it soon. thank you so much

@Sabri_Hoang

Your Welcome

Happy Automation !!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.