Skipping tasks based on Previous TestResult

David K.
Tucson, AZ

Apr 15, 2010
6 Posts

0  |  0  

Re: Skipping tasks based on Previous TestResult

I am trying to use the results from a previous test to define whether or not a following task is run. I am able to parse this fine using the Program.Tests("Test_Name").Result values but when I am not running a complete test and a task is unchecked but a sub test is checked the entire task is skipped. Any ideas as to how I can make sure that a checked test is run even if the full task is not selected?

Sample code from OnInitTest()

If (left(Test.Id,6)="XXX_XX")
     ! If XXX Self Test failed, skip this test
     If (Program.Tests("XXXX_SelfTest").Result = FAIL)
          Print "<br><b>Skipping " + Test.name + " test due to XXX Self-Test Failure...</b><br>"
          Test -1
     EndIf
EndIf

Thanks.

DrATEasy (Ron Y.)
Mission Viejo, CA

Apr 15, 2010
358 Posts

0  |  0  

Re: Skipping tasks based on Previous TestResult

Try to use the Status property instead of result property:

If (Program.Tests("XXXX_SelfTest").Status = FAIL)

David K.
Tucson, AZ

Apr 15, 2010
6 Posts

0  |  0  

Re: Skipping tasks based on Previous TestResult

Unfortunately the same result occurs. I have a failed test in Task 2 (XXX_SelfTest). Task 3 is skipped during OnInitTest() of 3.1 but then Task 4 is skipped (unchecked Task in Test Executive, only subtests checked) and Task 5 begins (Checked Task in Test Executive).

DrATEasy (Ron Y.)
Mission Viejo, CA

Apr 15, 2010
358 Posts

0  |  0  

Re: Skipping tasks based on Previous TestResult

If a whole task is skipped it's status will be NONE and not FAIL so check for both None or FAIL (you may also check for ERR).

Solution Available
David K.
Tucson, AZ

Apr 20, 2010
6 Posts

1  |  0  

Re: Skipping tasks based on Previous TestResult

I believe this actually has to do with how Test Executive goes about running a sequence of tests from the gui. I think I may open a magic incident and see what there response is. Thanks for the help!

DrATEasy (Ron Y.)
Mission Viejo, CA

Apr 21, 2010
358 Posts

0  |  0  

Re: Skipping tasks based on Previous TestResult

The problem you are seeing is relate to a test executive bug. To fix this you can modify the testexecutive driver as follows:
1. Locate the TestExec.OnInitTask
2. Modify line 14 as follows:

Instead of
                if not node.Checked
Change to:
                if not node.Checked and node.Bold=False


The code to skip task 3 I used the following to test it:

Program.OnInitTask()
{
    if Program.Tests("selftest_test").Status=FAIL
        if task.index=2
            ExitTask
        endif
    endif
}



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]