Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling nested actions from other tests

Status
Not open for further replies.

dlorde

Programmer
Jan 18, 2006
5
0
0
GB
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?
 
OK, problem solved. I tend to work in Expert View, and made the mistake of deleting an obsolete Action call from there - which doesn't delete the action reference, which becomes 'orphaned' in the test (you can't delete it from the Keyword view because it isn't visible), and messes up subsequent calls to an Action with the same name.

The QuickTest Plus 'External Action Call Modifier Utility' can delete these orphaned action call references.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top