Forum Discussion

rajeshthomas's avatar
rajeshthomas
Contributor
13 years ago

How to find whether a test item in enabled or not through script

Hi 



My test suite contains n no. of  test item. In that i have requirement to find out whether one particualr test item is enabled or not.  how can find out this by scripting. 



e.g.



Test Item name: TC_001_102030



While i am executing the testing there is one stage i need to find out whether the test item "TC_001_102030" is enabled so that perform those "XXXX" functions. How can i do this through script.



regrads,

Jesh
  • Do anybody  have any options to find whether the particular test case is enabled / not?
  • Anonymous's avatar
    Anonymous

    Hi Rajesh,



    I think TestItemObj.Enabled is what you are looking for. Is there anybody who has an example of how to use the property in JScript?
  • Hi Tanya,



    Thanks for your assistance. I am actually using the same script you have mentioned with some modification. But still it is too big when I see with my requirement. 



    For example: I just want to find out that "TC_001_45666" is Enabled or Not". Your script gives me the whole tree of test case and all its property.



    With my limited knowledge in scripting, i have modified the script in such a way that it can directly give me the answer whether the mentioned test cases is enabled or Not.

    But i know this is longest method to find out it. Can you please help me in finding the shortest method to find whether the particular test case ("e.g. TC_001_45666") which i ask is enabled or not.



    Note: Attached my script in a Zip file

    regrads

    Rajesh Thomas
  • lordsivan's avatar
    lordsivan
    Occasional Contributor


    • First get the Item count Using  Project.TestItems.ItemCount


    • Do a search using for loop to find the Project Item


    • Do a if condition to check whether item name is enabled or not.


    • Would post detailed article on this at

      Solution

      Reach me at Skype:- Testcomplete.expert