Forum Discussion

TanyaYatskovska's avatar
TanyaYatskovska
SmartBear Alumni (Retired)
10 years ago

New HOW TO Samples: working with Test Items and Windows

Greetings,

 

We have recently updated our How To section with new samples. Check them out:

 

Working with Test Items:

  "Run an individual test item via command line"

  "Run the specified group of test items via TestComplete's command line"

 

 

Windows Utility samples:

  "Click a flashing window in the Taskbar"

  "Get the latest folder from a path"

 

There are many other samples in How To, as well!

 

BTW, do you know that you may earn additional points to your Reputation by posting your samples in How To? Thus, if you feel that you have a sample that would be helpful for others, and you are willing to share it – get in touch with me at tatyana.gorbunova@smartbear.com.

 

Enjoy testing!

2 Replies

  • jose_pita's avatar
    jose_pita
    Super Contributor
    I just quickly read through those 2 first links, but one question remained, Is it possible to run one keyword test with TE without knowing wich project it is attached too?



    Picture this:



    1 folder with hundreds of tests inside.



    best case scenario: in a batch file, add all those test to a project and run the project in order to get a good report



    Best scenario number 2: in a batch file, run through all those file running each test at a time independently of the project they are attached to...



    if this is not possible, what alternatives do I have to do something like this?
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Jose,

     


    The TestComplete Integration object can help you. However, you will need to learn at least the name of the project where your keyword tests are located. If it's possible, you can do this by adding the following script when parsing the command-line parameters:


     




      var tc = Sys.OleObject("TestComplete.TestCompleteApplication.10");


      tc.Integration.RunTestByName("projectName", "KeywordTests|Test2");




     


    You can get project and keyword test names by using the approaches listed in the How To articles.


     


     


    Now, if you don't know the project name.


    I guess you can get the full structure of a project from project files (*.pjs, *.tcKDT, etc.). However, you will need to create a parser to obtain this information from the files. There are many disadvantages in this approach. Here are the main ones:


     


     - The structure of these files isn't documented. So, you will have to parse them yourself. 


     - If the structure of the files is changed, you will have to recreate your parser.