How to avoid certain "Stop on Error" scenarios?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to avoid certain "Stop on Error" scenarios?
Hello, I have my project configured to Stop on Errors when I run my test cases, but there are some errors which are not functional bugs (very frequently the TestedApps.App.Run() fails to open the desired application and it stops the test). Is there a way to bypass or make the "Stop on Error" property ignore these scenarios? Because if TestComplete fails to open one of my applications, I would like to retry opening it and continue the test, but so far I have tried putting that code inside a "try-catch" (javascript) block, and the test is still stopped, ignoring the "try" block.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> Is there a way to bypass or make the "Stop on Error" property ignore these scenarios?
I am not aware about such option.
You may consider opposite approach - do not stop test on error but use Runner.Stop() / Runner.Halt() methods to stop test when really needed.
/Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have considered that, but I still want to stop on errors when, for example, a Click() in an object fails, or a Checkpoint fails. I just want to avoid the Stop when the TestedApp fails to Run() (or find a workaround to make it open 100% of the times without errors).
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This might be a bit basic, but what about just adding an If..Then statement to look for the needed process to be running.... and if not then launch it.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @brumazz , my code looks something like this:
if not (Sys.WaitProcess("myapp.exe").Exists) {
TestedApps.MyApp.Run() // <--- Here Test Complete throws an error 4/10 times, and the execution is stopped even if I put it inside a try/catch
}
The problem here is how TestComplete manages the errors with the "Stop On Error" option selected (or, to be more specific, the fact that TestComplete throws errors on simple actions as opening an application). It would be great if there is a way to ignore these type of errors, because I could simply manage them by "retrying" one more time the same action until succeeds.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What about changing the playback to retry failed test items?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@brumazz I considered that too, but some of our tests take more than 30 minutes and after that time when an application should be opened to verify something, the "re run" option would add another 30 minutes to the execution just because TC couldn't open an application.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm sorry, I may be confused, but this setting is not going to re-run the entire test....just the failed test step.
So, say you have 1 test step that that validates that the app is open.
Given you have changed that setting, it would retry the validation...not the entire test.
Also, have you tried doing any of this in a KeyWord Test?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @brumazz , I just checked again the stop and re run current item option based on your comments, and I can confirm it does not work as you said. It re-runs the entire test case again. Here you can see the result of running a test that fails in one step: the entire test is re-run after it fails.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This week I search to edit delay value inside the scrip, and works as well.
I go search again the documentation to help you. Take a look on this reference (https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/misc/options/index.h...), but I believe you can't edit this property anymore ..
StopOnError
This property is obsolete. It is supported for backward compatibility only.
Error handling > On error project property. Boolean. Read-only. If the project property is set to Continue running, returns false. Otherwise, returns true.
Check this too (https://support.smartbear.com/testcomplete/docs/working-with/managing-projects/properties/playback.h...)
reading I believe there is a way to edit with a plugin script, but I dont know if works in time of execution
