Forum Discussion

david_quick's avatar
david_quick
Occasional Contributor
11 years ago

Setting Project Test Items Count via Script

Is there a way to programmatically set a project test item's count?



The TestItem Object only provides access to the property values, not set them.



Here's the VB script I am running:



sub sub_SetTestItemCount '(strTestItemName) <-- commented out while debuging

 

' Setup Temp value for Debuging

strTestItemName = "Expected Project Test Item Name"

 

  ' Loop through each of the project test items

  For intFirstLevelTestItems = 0 To Project.TestItems.ItemCount-1

 

   ' If the name of the test item is the same as the passed in value

    if LCase(Trim(Project.TestItems.TestItem(intFirstLevelTestItems).Name)) = LCase(strTestItemName) Then

   

      ' Update the Test Item Count to a new value

      Project.TestItems.TestItem(intFirstLevelTestItems).Count = 5

      ' Code fails on above line as Read/Get only NOT Write/Set

     

    End If

  Next


  • Hi David,


     


    I found the same support ticket you submitted to our TestComplete Support Team. Let me quote their reply here so that other community members are aware of this:




    Currently, the TestItem.Count property is actually read-only. However, we have a suggestion to implement the ability to modify this property from the test in our database, and your message has increased its rating. Thank you.


     


    In the meantime, to accomplish the task, you can implement the loop that will control how many times a test item will be executed. I hope this will help.




     

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi David,


     


    I found the same support ticket you submitted to our TestComplete Support Team. Let me quote their reply here so that other community members are aware of this:




    Currently, the TestItem.Count property is actually read-only. However, we have a suggestion to implement the ability to modify this property from the test in our database, and your message has increased its rating. Thank you.


     


    In the meantime, to accomplish the task, you can implement the loop that will control how many times a test item will be executed. I hope this will help.




     

    • sdahiya's avatar
      sdahiya
      Occasional Contributor

      Hi,

       

      Is there any progress regarding this issue?

      Or how long will it take in order to implement such feature?

       

      I am using Testcomplete version 10.50.2702.7

       

      P.S: It is almost one year about this topic and Test complete does not provide any concrete solution or atleast details how long will it take to adapt this feature??