mgroen2's avatar
mgroen2
Super Contributor
8 years ago
Status:
New Idea

Implement "Parameter loop"

Referring to this post.

 

I would like TC to have a feature, somewhat similar the "Browser loop" implemented, that will run a specific test (which has parameters) to iterate through all parameters, each iteration set with one parameter value = NULL (or a user-defined value).

 

That way you can quickly test how the application you are testing handles empty parameters (negative testing).

 

Currently you can build your own solution (as described here), but this solution requires a lot of maintenance in applications changing amount/order of parameters.

 

 

10 Comments

  • cunderw's avatar
    cunderw
    Community Hero

     What about using a data driven loop and excel for your parameters? As long as you loop from beginning to end, if you need to adjust or add more, just change the data in the excel sheet. This sounds like it's exactly what you're asking for and requires little maintenance. 

  • mgroen2's avatar
    mgroen2
    Super Contributor

    cunderw I think you're right. But I also think that by adding this (sort of ) function(s) to TC, the work of a tester could be done faster. What I mean is, that by implementing this 'intelligence', TC could even be a better tool for testing things faster. And, when needed for additional, thorough testing, tester can make use of  external data sheets.

     

    Hope it's clear what I am pointing to.

  • cunderw's avatar
    cunderw
    Community Hero

    You could even just have a table variable with the needed data and loop through that. The functionality is already there really, just the terminology is not called parameter loop. What you're wanting is to loop through a set of data. 

     

     

  • mgroen2's avatar
    mgroen2
    Super Contributor

    cunderw Correct once again, with the remark that I'd think TC could provide some sort 'default looping' so that it's not necessary to create/maintain external data files to quickly test against empty param values.. That would speed up testing (which becomes more and more relevant in Agile/ Continious deployment environments).

     

  • cunderw's avatar
    cunderw
    Community Hero

    It's not internal, the table variable type exists inside test complete just like parameters do. No external file required. Perhaps I'm not understanding exactly what you're asking?

  • mgroen2's avatar
    mgroen2
    Super Contributor

    cunderw Could be that we have some misunderstanding. Check this thread for more clarification on it.

    Do you think you can create a solution for it without the need to scripting and/or use external data files?

     

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Interesting idea.. so, TC would have to be "smart" to adjust the loop for the parameters based upon the parameters on the test without needing user intervention, yes?

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Question: While it will update the length of the loop based upon the parameter count, how would TC know how to populate the added parameter? For example, if you have 5 string parameters and add a 6th, what data should be populated for the 6th parameter? I mean, obviously TC could be smart to somehow detect whether the param is a string, a numeric, or some other thing, but the values need to be meaningful to the keyword test in order for the test to not just fail outright because the string is an unmapped value or the numeric is out of range. You will still, probably, need to do some manual intervention in order to indicate the data to be populated... which is back to the DataDriven scenario where you would specify a table to loop through that you have control over.

  • mgroen2's avatar
    mgroen2
    Super Contributor

    tristaanogre when you extend the amount of parameter list you must declare its (the new) parameter including its type. Nothing new there. And during test execution, TC is looping through the parameters (including the new one), which uses its normal value (existing functionality), and the 'special value' (new functionality), e.g. 'null'.

     

    The main thing TC has to do in this feature, prior to test execution count the number of params, and during execution insert the value specified by the tester.