SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Apr 2007
    Posts
    86
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Preventing deletion of test if it\'s in a set

    Greetings.

    I'd like to be able to prevent users from deleting a test in Test Plan if that test is in any test set in Test Lab. Unfortunately, there is no indicator in the TEST table (accessible easily from within the Test Plan workflow code in, say, the Test_CanDelete function) that lets me know if the test is in any test set.

    Is there any easy way to hit the TESTCYCL table to look for the test's ID in the TC_TEST_ID column to see if it exists anywhere?

    As an alternative, I guess I could use the TestSet_CanAddTests and TestSet_CanRemoveTests events to establish and increment counters on the tests in the TEST table, indicating how many test sets the test has been added to. But that seems awful kludgy.

    Any assistance would be greatly appreciated. Thanks!

    --m.a.g.

  2. #2
    Senior Member
    Join Date
    Mar 2007
    Posts
    243
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Preventing deletion of test if it\'s in a set

    another method I have seen used. Is that all groups are not allowed to delete tests in the Test Lab. Instead a folder "trash" was created and the tests are moved to the Trash when they want them deleted. Then periodically the admin dumps the trash (like end of every cycle). That should give them time to figure out that they really needed the test.

    If you search the forums alittle more I think there are some threads regarding test factory filters. That may make your way work a little easier.

  3. #3
    Member
    Join Date
    Apr 2007
    Posts
    86
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Preventing deletion of test if it\'s in a set

    Cuthbert --

    Thanks for the response!

    I didn't find a whole lot of examples that really helped in the forums, but when I checked the OTA API Reference help file, now that I knew what I was looking for, I got what I needed. Thanks for pointing me in the right direction!

    My working code follows, for anyone else who might ever need it. (This is in QC 9.2, for what it's worth....)

    -- m.a.g.

    Function Test_CanDelete(Entity,IsTest)
    On Error Resume Next

    Test_CanDelete = DefaultRes

    Dim tsf ' Test in Test Set Factory
    dim tdf ' TestDirector Filter
    dim tsList ' list of tests in test sets

    If IsTest Then
    Set tsf = TDConnection.TSTestFactory
    Set tdf = tsf.Filter
    tdf.Filter("TC_TEST_ID") = Entity.Field("TS_TEST_ID")
    Set tsList = tdf.NewList
    If tsList.Count > 0 Then
    ' The test is in at least one test set. Disallow deletion.
    Test_CanDelete = False
    MsgBox "You may not delete tests that are in test sets."
    End If
    Set tsList = Nothing
    Set tdf = Nothing
    Set tsf = Nothing
    End If

    On Error GoTo 0
    End Function

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:44 AM.

Copyright BetaSoft Inc.