Micro Focus QTP (UFT) Forums
calling more than one test using driver script - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: calling more than one test using driver script (/Thread-calling-more-than-one-test-using-driver-script)



calling more than one test using driver script - pspsblog - 08-02-2009

How we can call more than one tests in a driver test?
Say I have test1, test2, test3.
if TC# is 1, I want to run test1...
is there any method to run a test or can we use quick test application object..I don't want to change my test into functions and use runaction.


RE: calling more than one test using driver script - basanth27 - 08-07-2009

Options are available. You may need to pick yours.

1. you can load all the tests you have into a excel sheet, mark a execute flag and then loop through it using a external VBScript and it will initiate the execution. Yes, here you will need to use the QTP AOM.

I dont know if you can do it through QTP. However your last statement talks about "RunAction"...What does that mean ??


RE: calling more than one test using driver script - pspsblog - 08-09-2009

Thanks! Can you pls give me the sample script to call a test using AOM.
First I create a qucik test object and the launch and visible is set to true and then how to specify the path for the test I want to call.

Run action is for calling/executing an action if I change/save tests as action and then I can call the action if the flag is set Y in the xls.


RE: calling more than one test using driver script - rameshrise3 - 08-12-2009

Hi,
U can try the following:
Test Data file(Excel) should have 2 fileds, 1.Script Name & 2.ToBeExecuted and the Driver Scripts will be as follows.

Code:
MyTest = DataTable.Value("Script", 1)
If DataTable.Value("ToBeExecuted", 1)= "YES" Then

Select Case MyTest

      Case "Test1"    
          RunAction("Test1", oneIteration)
    Case "Test2"    
          RunAction("Test2", oneIteration)
    Case "Test3"    
          RunAction("Test3", oneIteration)

          ---------
          
   End Select
Else
Reporter.ReportEvent 1, "-------------", "-------------------"
End If



RE: calling more than one test using driver script - Saket - 08-12-2009

Hi Pspsblog,

You can use Object.Open method to open your Test.
Syntax for this will be

Object.Open TestPath,OpenInReadOnlyMode,SaveCurrent

where
object : QTP Aplication object,
TestPath " Path for your test
OpenInReadOnlyMode : Optional [True/False]
Save Current : Optional [True/False]

Hope this will help you

Rameshrise3 - RunAction Statement can be used only for call a reusable action, you will not be able to call a test using RunAction