error handling with TestPartner in context with QADirector automatic testing
We have some scripts with "On Error Resume Next" handlers.
Whenever an error occurs a TestPartner log entry is created, stating that something failed.
In our case these errors are handled and are not representative for the overall test results.
But when we start the tests with QADirector, QADirector seems to evaluate these log entries or rather the errors and decides that the concerned tests failed.
So either we have to use a different error handling or pass an explicit "PASSED" to QADirector.
The tested application is a web-application, though I do not think that this matters.
the error handlers are used in e.g. the following contexts:
try to attach to a window; if it fails, wait a while and try again, if it still fails, do something else or actually complain
For i = 0 To 10
On Error Resume Next
bReturnCode = Window(sWindowname, tpAttachNoWait).Attach()
If bReturnCode = True Then
functionname = True
There is a TestPartner example code of TOnError, but if I use that, I still end up with a Run-Time error'424' Object Required :
Dim oe As TOnError
Set oe = OnError("MyErrorFunction")
Function MyErrorFunction() As tpOnErrorType
MyErrorFunction = tpResumeNext
If I instead use "Window(sWindowname).exits", I get an error: Run-Time error '-2147467259(80004005)'
The attach name "blabla" could not be found
Now, I do not know how to use a different method of error handling and I do not know how to convince QADirector that all is fine, whenever we think it actually is.
Re: error handling with TestPartner in context with QADirector automatic testing
Corrections to former post
I found a couple of errors in my above examples:
only raises an error, if the window actually does not exist AND sWindowname is not in the form:"Caption='Window Title'"
The main problem still exists (just the examples are bogus).
How do I convince QADirecor to not interpret a raised error in a TestPartner script.
When I use "qc_exec.exe subtest_pass" in the TestPartner script, the sub_test will pass, whenever I want it to, but the Procedure (in QADirector), that includes the subtest will fail.