SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Advanced Member
    Join Date
    Apr 2005
    Location
    Maryland
    Posts
    555
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Preventing user from executing a test that is assigned to a specific Cycle

    We want to be able to execute mutilpe Cycles of testing in a project but want to prevent changes to the previouse test cycle, but we want users to be able to see the old cycle (So just hiding it in the groups data hiding is not an option). This works but users can still change the code using the grid in the test Lab. I cant get an action name for teh changes to the test instance in the grid. does anyone know how to get the grid action?


    here is the code I have now :

    Code:
       If ActiveModule = "Test Lab" then
         msgbox ActionName
      if ActionName = "act_run" Or "act_run_test_set" Or "act_run_manually" Or "act_continue_man_run" Or "ContinueManRunAct"  then
    
             If TestSet_Fields.Field("CY_ASSIGN_RCYC").Value = "Cycle 1" Then
                'Template_ActionCanExecute = False 'Code to use if using ALM templates
                msgbox "The test case you are trying to execute has been closed.  Please contact your project administrator for more information"
                DefaultRes = False
             Else
                 'Template_ActionCanExecute = True  'Code to use if using ALM templates
                 DefaultRes = True
             End If
           Else
              'Template_ActionCanExecute = True  'Code to use if using ALM templates
            DefaultRes = True
    
         End If
       End If
    
      ActionCanExecute = DefaultRes
    ' On Error GoTo 0
    End Function
    Last edited by JustHuman; 01-24-2013 at 07:50 AM. Reason: I consolidaded the Select Case into a logical Or
    Alfredo R. Rivera
    IT Principal SDLC Automation Subject Matter Expert
    (CCRC/CQ/CQTM/RMT/RFT/RPT/REQPRO)
    (LR/QTP/CQ/SS/WR)
    Certified Mercury Interactive Instructor
    Certified Tester, Foundation Level (CTFL)
    www.fredotech.com
    www.testingframework.com
    www.automationtesting.org
    http://www.linkedin.com/in/fredotech

  2. #2
    Advanced Member
    Join Date
    Nov 2006
    Posts
    821
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0
    What about putting code in the TestSetTests_CanPost or TestSetTests_FieldCanChange to block changes to test instances that are part of the locked test cycle?
    Trudy C
    (Opinions and information contained in this post are wholly my own and do not reflect the opinions of my employer.)

  3. #3
    Advanced Member
    Join Date
    Apr 2005
    Location
    Maryland
    Posts
    555
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Ok after some tial and error and alot of cursing here is what i have found. there is no way to refrence the target cycle in the API work flow and the ALM 11 Readme file confirms

    Open Test Architecture/API and Workflow
    •The NewValue parameter in the FieldCanChange workflow event does not return a value when changes occur to the Target Cycle or Target Release field values.


    I have tried : TestSet_Fields.Field("CY_ASSIGN_RCYC") & TestSet_Fields.Field("CY_ASSIGN_RCYC").value as well as the test instance field: estSetTest_Fields.Field("TC_ASSIGN_RCYC").Value & estSetTest_Fields.Field("TC_ASSIGN_RCYC").Value


    But again in thining about it if I have 2 cycles with the same name under 2 diffrent releases this solution would fail.

    So i decided to create a user defined field that will be used to lock the test instance.

    You will need to create a user defined field in teh test instance in the project enteties to make this work. and you can assign that only the project admins can manage it to ensure lock.

    Code:
    ################### Final Solution
    
    Function ActionCanExecute(ActionName)
      'Use ActiveModule and ActiveDialogName to get
      'the current context.
       On Error Resume Next
    
    
       If ActiveModule = "Test Lab"  Then
        Select Case ActionName
         Case "act_run" Or "act_run_test_set" Or "act_run_manually" Or "act_continue_man_run" Or "ContinueManRunAct"
    
              If TestSetTest_Fields.Field("TC_USER_01").Value = "Y" Then
                'Template_ActionCanExecute = False 'Code to use if using ALM templates
                msgbox "The test case you are trying to execute has been closed.  Please contact your project administrator for more information"
                DefaultRes = False
             Else
                 'Template_ActionCanExecute = True  'Code to use if using ALM templates
                 DefaultRes = True
             End If
            Case Else
            'Do nothing
            'Template_ActionCanExecute = True  'Code to use if using ALM templates
            'DefaultRes = True
    
         End Select
       End If
    
    
    
    
      ActionCanExecute = DefaultRes
    On Error GoTo 0
    End Function
    
    
    Function TestSetTests_FieldCanChange(FieldName, NewValue)
      On Error Resume Next
    
    
              If TestSetTest_Fields.Field("TC_USER_01").Value = "Y" Then
                'Template_ActionCanExecute = False 'Code to use if using ALM templates
                msgbox "The test case you are trying to execute has been closed.  Please contact your project administrator for more information"
                DefaultRes = False
              End If
    
      TestSetTests_FieldCanChange = DefaultRes
      On Error GoTo 0
    End Function

    I hope this helps someone else in the future. I welcome the feedback but for now I have a solution.
    Alfredo R. Rivera
    IT Principal SDLC Automation Subject Matter Expert
    (CCRC/CQ/CQTM/RMT/RFT/RPT/REQPRO)
    (LR/QTP/CQ/SS/WR)
    Certified Mercury Interactive Instructor
    Certified Tester, Foundation Level (CTFL)
    www.fredotech.com
    www.testingframework.com
    www.automationtesting.org
    http://www.linkedin.com/in/fredotech

  4. #4
    Advanced Member
    Join Date
    Apr 2005
    Location
    Maryland
    Posts
    555
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    thank you for teh reply I eneded up adding code in the TestSetTests_FieldCanChange that is triggered on changes in the test instance and this works.
    Alfredo R. Rivera
    IT Principal SDLC Automation Subject Matter Expert
    (CCRC/CQ/CQTM/RMT/RFT/RPT/REQPRO)
    (LR/QTP/CQ/SS/WR)
    Certified Mercury Interactive Instructor
    Certified Tester, Foundation Level (CTFL)
    www.fredotech.com
    www.testingframework.com
    www.automationtesting.org
    http://www.linkedin.com/in/fredotech

  5. #5
    Advanced Member
    Join Date
    Apr 2005
    Location
    Maryland
    Posts
    555
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Quick Update I added code to allow the TDamin group be able to unlock the test case

    Code:
    Function TestSetTests_FieldCanChange(FieldName, NewValue)
      On Error Resume Next
         If User.IsInGroup("TDAdmin") then
           If TestSetTest_Fields.Field("TC_USER_01").Value = "Y" Then
                MsgBox User.FullName & vbcrlf & vbcrlf & "You Have Administrative Privileges" &vbcrlf & vbcrlf &"The test case you are trying to execute has been closed. As Project administrator YOu can make Changes", vbExclamation, "Special Action Allowed"
                DefaultRes = True
              End If
    
          Else
              If TestSetTest_Fields.Field("TC_USER_01").Value = "Y" Then
                'Template_ActionCanExecute = False 'Code to use if using ALM templates
               MsgBox User.FullName & vbcrlf & vbcrlf & "You don't have enough privileges" &vbcrlf & vbcrlf &"The test case you are trying to execute has been closed. Please Contact your Project administrator for more information", vbExclamation, "Action Not Allowed"
                DefaultRes = False
              End If
         End if
    
      TestSetTests_FieldCanChange = DefaultRes
      On Error GoTo 0
    End Function
    Alfredo R. Rivera
    IT Principal SDLC Automation Subject Matter Expert
    (CCRC/CQ/CQTM/RMT/RFT/RPT/REQPRO)
    (LR/QTP/CQ/SS/WR)
    Certified Mercury Interactive Instructor
    Certified Tester, Foundation Level (CTFL)
    www.fredotech.com
    www.testingframework.com
    www.automationtesting.org
    http://www.linkedin.com/in/fredotech

 

 

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 12.50%
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 04:16 PM.

Copyright BetaSoft Inc.