Driver Script To Run Multiple QTP Scripts
Driver Script To Run Multiple QTP Scripts
Hi,
If you just wish to control the execution of QTP Actions, you don't need anything
special.
I'll describe a simple way of achieving your goal with really minimum development
effort.
1) Let's agree that your QTP test is a script that should run a sequence of actions.
Each action can be a test on its own, or really a part of a more complex test.
2) In such a case:
a) Your main action (e.g., Action1) would contain the code as shown below.
b) Define environment variables as required:
TEST_FLOW
MIN_ACTION
MAX_ACTION
You can define these in the test or in an external xml file to be loaded at run-time
with:
Code
GeSHi (qtp):
Environment.Load(<Pathname>)
blnBreak = False
intCurAction = 0
End If
intMaxAction = Environment("MAX_ACTION")
End If
intCurAction = intMinAction
Do
intCurAction = intCurAction+1
Another approach (as you suggested) is to define per action whether to run it or not.
Please note that this requires that the actions ARE NOT functionally dependent.
You can achieve this by defining an environment variable for each to-be-run action
(e.g., Create Service Package) and assigning it a value of, for instance, Y/N.
Then your loop code would change to:
Code
GeSHi (qtp):
Do
End If
intCurAction = intCurAction+1
Give a try with this code from vbs file. It might work.
qtApp.Launch
qtApp.Visible = False
If Not(qtApp.TDConnection.IsConnected) Then
qtApp.TDConnection.Connect "http://xxxxxxxxx/qcbin","Domain", "Project", "uid",
"pwd", False
End If
qtApp.Test.Run
qtApp.Test.Run
qtApp.Test.Run
qtApp.quit
End Function
Call testFunc()