Test items should be unchecked to prevent double execution - when going through the test items' tree and when executing child test items (as you run the project)
The script seems to need correction
...
Sub runTestItemRoutine(TestItemLevel)
If Not TestItemLevel.ElementToBeRun Is Nothing Then
caption = Split(TestItemLevel.ElementToBeRun.Caption, "\")
If caption(0) = "Script" Then
script = Split(caption(1), " - ")
If script(1) <>"Main" Then
Runner.CallMethod(script(0) + "." + script(1))
End If
End If
End If
End Sub
function runTestItemRoutine(TestItemLevel)
{
if (TestItemLevel.ElementToBeRun != null)
{
var caption = TestItemLevel.ElementToBeRun.Caption.split("\\");
if (caption[0] == "Script")
{
var script = caption[1].split(" - ");
if (script[1] != "Main")
Runner.CallMethod(script[0] + "." + script[1]);
}
}
}
You can run selected test items from script (run Main without running the project):
...
Sub runTestItemRoutine(TestItemLevel)
If Not TestItemLevel.ElementToBeRun Is Nothing Then
caption = Split(TestItemLevel.ElementToBeRun.Caption, "\")
If caption(0) = "Script" Then
script = Split(caption(1), " - ")
If script(1) <>"Main" and TestItemLevel.Enabled Then
Runner.CallMethod(script(0) + "." + script(1))
End If
End If
End If
End Sub
...
function runTestItemRoutine(TestItemLevel)
{
if (TestItemLevel.ElementToBeRun != null)
{
var caption = TestItemLevel.ElementToBeRun.Caption.split("\\");
if (caption[0] == "Script")
{
var script = caption[1].split(" - ");
if (script[1] != "Main" && TestItemLevel.Enabled)
Runner.CallMethod(script[0] + "." + script[1]);
}
}
}