Forum Discussion
Hi,
Personal private opinion based on the projects I participated in:
a) TestComplete provides call stack in the Call Stack log pane. I think that the provided call stack is good enough and is bound to the test code making it possible to navigate to code from call stack. At the same time I don't see any good reason to post a full call stack to the test log itself because test log should be compact, readable and understandable for non-programmers (like manual testers or managers). Thus I don't see the reason in getting call stack from exception.
b) The only case when exceptions were useful in test code was for web services testing when the service was called with incorrect parameters in order to get the 4xx return code. In all other cases the called function either reported a problem or returned an indication of success/failure processed by the calling code as required. This was always possible because, by definition, test code always perform defined action to verify defined behaviour and thus always know expected code call result. In case test code fails because of unexpected situation (e.g. when attempting to write to a read-only file), then it is perfectly fine if the code fails. This reveals but not hides the code problem which can be immediately addressed. If it is possible that the given file can be read-only, then test code must be improved to make file writable before writing to it. If the file must not be read-only, then test code must be improved with verification block and clearly report a problem to the test log.