Forum Discussion

mgreen's avatar
mgreen
Contributor
5 years ago

Calling Group of tests, or test items in Script Mode.

I have in my Test Items Page a series of folders each containing Test Items.  I.e  Login Procedure folder, Navigation Folder, Functional Tests folder etc etc.

 

Am I able to start a group of tests, or test items in Script Mode?  I see in the documentation you can call Keyword Tests and such, but I am looking to "Run" the tests of a specific folder from a function in one of my scripts that is attatched to a user form button.

 

//*** Here is my function to spin up the User Form
function start(){
UserForms.UserForm1.ShowModal();
}

 

//*** User clicks on the button, and I want it to run a Group of Tests Items

 

function UserForm1_cxButton1_OnClick(Sender){

 

}

 

 

Any guidence here? 

 

Thanks

 

10 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    You could create a function/method, that simply calls the indicated scripts in sequence and associate that with your button.  Technically, with the way you're running things, there's not really a reason to use TestItems... your userform and the code behind controls execution order.

    • mgreen's avatar
      mgreen
      Contributor

      The test Items have parameters I pass through to them via the Test Item Page.. 

       

      Is there a way to call a group of tests versus having to put each function (test) in order?

      There are a few hundred in each folder. 

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Via script code (or keyword test code) there is no interface to execute a test item directly.

       

      Project.TestItems.TestItem(<index>) returns the test item, but there is no execution method.  TestItems, themselves, are the means for executing either scripts or keyword tests via a visual interface without writing code.  If you want to execute a sequence of script routines (with parameters) in a particular order, you will need to write a calling routine as mentioned.

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        It looks like you're trying to create yet another UI when you might not need one.

         

        If you want users to be able to run a certain set of tests, then you can set them up in something like Bamboo or GoAnywhere and inside that tool, have a TestExecute job that runs the tests that you want.