Hi Stephen,
You can recursively traverse the project Test Items tree and run all scripts in it. To do this, follow the steps below:
1. Assign HeadIteration to a script routine that contains the following code:
Sub Main
Dim Driver
Set Driver = DDT.ExcelDriver("C:\MyFile.xls", "Sheet1")
RecNo = 0
While Not Driver.EOF
Project.Variables.Var1 = DDT.CurrentDriver.Value(0)
Call RecursiveTraverse(Project.TestItems)
Call Driver.Next()
WEnd
Call DDT.CloseDriver(Driver.Name)
End Sub
Sub RecursiveTraverse(Level)
Items = Level.ItemCount
For i = 0 to Items-1
Call runTestItemRoutine(Level.TestItem(i))
Call RecursiveTraverse(Level.TestItem(i))
Next
End Sub
Sub runTestItemRoutine(TestItemLevel)
If Not TestItemLevel.ElementToBeRun Is Nothing Then
caption = Split(TestItemLevel.ElementToBeRun.Caption, "\")
If caption(0) = "Script" Then
script = Split(caption(1), " - ")
Runner.CallMethod(script(0) + "." + script(1))
End If
End If
End Sub
2. Disable all project test items, except for HeadIteration (the top-level one).
3. Run the project.
For more information, refer to the
Runner.CallMethod and
TestItems Object help topics.