I'm using the Java add-in with QTP 8 to test a Java client application. For this I need a number of reusable actions to do basic operations (LaunchApplication, Login, SearchForData, etc).
One common resuable action is 'HandleServerResponse' which must be called after every server query to deal with potential errors. This action is called from other resuable actions in the same test (e.g. SearchForData) and they work OK together as nested reusable actions in that test.
However, when I call the SearchForData action from another test, as an external action, it runs OK until it reaches the nested HandleServerResponse action, at which point it complains that the Action was not found.
I guess that this is because this doubly nested action is not called as an external action (i.e. with the test name appended) inside the SearchForData action.
There are several other nested resuable actions where this kind of problem is likely to occur when they are called from other tests.
Is there a recognised approach to structuring the hierarchy of nested reusable actions that will avoid this problem when used in several tests?
I could put every reusable action into its own test, so they would always be called as external actions, or I could try to ensure that no reusable action in a test calls any other resuable action in the same test, or I could even assemble the full action names on-the-fly for the RunAction calls - but none of these seem to be satisfactory solutions.
Any ideas?
One common resuable action is 'HandleServerResponse' which must be called after every server query to deal with potential errors. This action is called from other resuable actions in the same test (e.g. SearchForData) and they work OK together as nested reusable actions in that test.
However, when I call the SearchForData action from another test, as an external action, it runs OK until it reaches the nested HandleServerResponse action, at which point it complains that the Action was not found.
I guess that this is because this doubly nested action is not called as an external action (i.e. with the test name appended) inside the SearchForData action.
There are several other nested resuable actions where this kind of problem is likely to occur when they are called from other tests.
Is there a recognised approach to structuring the hierarchy of nested reusable actions that will avoid this problem when used in several tests?
I could put every reusable action into its own test, so they would always be called as external actions, or I could try to ensure that no reusable action in a test calls any other resuable action in the same test, or I could even assemble the full action names on-the-fly for the RunAction calls - but none of these seem to be satisfactory solutions.
Any ideas?