Forum Discussion

deepika1124's avatar
deepika1124
New Contributor
7 years ago

Does Test Complete have feature of explicit looping or script looping fetaure

Could you explain if the explicit looping or script looping feature is available.

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I'm not sure exactly what you mean.  The term "explicit looping" is not something I'm familiar with with regards to TestComplete.. but there are various ways of building loops within tests in TestComplete.  Within Keyword Tests, you have basic loops like for and while loops that operate very much like they would within any script code language... likewise, whatever code language you choose for actually writing script code has it's own syntax for loops.

     

    If using keyword tests, there is the Data Driven Loop operation that you can use to wrap around a set of operations to build a loop based upon an input data set. 

     

    If you're doing web based testing, you can also build a browser loop to loop a particular set of operations through a set of browsers for cross-browser testing.

     

    If you're writing script code, you can build loops based upon the DDT objects to retrieve data and then use a while loop in order to loop through the resulting data set.  Or, you could write an SQL query using ADO objects to return a record set and use a while loop as well.

     

    Different objects you can retrieve from your application or from other areas of your script can be returned as iterator objects which you can then loop through (if this is what you mean by explicit looping).  Some of this may be dependant a bit on your chosen code language.

     

    So... yes... you can loop lots of stuff... but if you can explain more what you mean by "explicit looping", we might be able to match an answer better for you.

    • deepika1124's avatar
      deepika1124
      New Contributor
      Thank you for the reply . Here is the scenario- Suite 1 Test case 1 Test Case 2 Test case 3 Here each test case is a different module or function and every test case has its own data loop. Test case 1,2 and 3 need to be run one after the run. Then can we run suite 1 in a loop so that for every run these 3 test cases are run in above conditions?
      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Quick answer is "yes"... but there are many ways of doing this.  You could set up another function that calls those three test cases within a loop and execute that function as your "suite", you could set up Test Items where each of the three test cases are child items of a parent test item which has an count setting indicating how many times you do it in the loop.