Forum Discussion
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.
- tristaanogre7 years agoEsteemed 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.
- deepika11247 years agoNew Contributor
Is there in built function within test complete or could you please provide a sample as how to run scripts in loop.
That would be very help full. Thank you.
- tristaanogre7 years agoEsteemed Contributor
This screenshot shows a very simple way of doing so. If I have two keyword tests that I want to run and I want to loop them through three times, I can do something like this
For some situations this works. You can find out about this at http://support.smartbear.com/testcomplete/docs/working-with/managing-projects/project-editor/test-items-page.html
The draw back of this method is that there is no programmatic control over the loop. You are simply looping the test cases multiple time. You would have to have the first item run a test that would actually set certain parameters that the other two tests would use to get each time through the loop to run differently.
I prefer looping in code using while or for loops if I need to loop something. But while you gave an example of what you want to do, it's still a very general example. I'm assuming you know how to write while or for loops in code so, if you can clarify if there is something more you want to achieve, I'll certainly try to help. Perhaps a more concrete example of what you are attempting to achieve.
Related Content
Recent Discussions
- 6 hours agotramuntana
- 2 days agoSlickRick