Forum Discussion

Dewayne_Pinion's avatar
Dewayne_Pinion
Contributor
9 years ago
Solved

Want to control the indicator during a test run

All, I would like to give visual cues to people viewing the automated testing progression of our software. What i would like to do is use the indicator to display the current running test item, as well as "x out of y" number of tests. I know that:

 

Indicator["PushText"]() displays data on the indicator and PopText and Clear remove the current text in their own ways. I also know that Project.TestItems.Current gets the current TestItem and you can iterate through them all using Project.TestItems

 

However, how do I do what I am wanting to do? I haven't been able to piece it together yet. So when the project is being ran, I would like the indicator to be updated with the current running test case and the current number out of the total. I am unsure how I would keep these items up without having to insert script in each of my units, which I would like to avoid.

 

Thanks

3 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    TestComplete doesn't know the name of the test that's being executed while the execution is happening.

     

    What I did to implement what you want is to put a push at the top of every script that puts the name/message out to the indicator.  If you have a master test, you'll want a pop right after each script call so you'll know you've reverted back to the master.

    • mes6073's avatar
      mes6073
      Contributor

      We implemented a couple 'wrapper' procedures which are called prior to and upon conclusion of a scenario:

       

       

      Sub ScenarioStart(ByRef intCount, strDescription, sIndicator)
      
         Log.AppendFolder(strDescription)
         Indicator.PushText(sIndicator)
         intCount = intCount + 1
         
      End Sub

      Sub ScenarioEnd(bResult, ByRef intSuccess)

      Indicator.PopText()
      Log.PopLogFolder()

      If (bResult = True) Then
      intSuccess = intSuccess + 1
      End If

      End Sub ' ScenarioEnd