Forum Discussion

gdave's avatar
gdave
Regular Contributor
7 years ago
Solved

Test Parameter

Hi all

 

I was wondering if someone can tell me if there is a way not to get the attached message everytime I try and execute my test using test parameter. Thanks

 

 

  • Unfortunately, no.  

     

    Think of it in terms of code.  If I write a function like this

     

    function yada(foo, bar){
        Log.Message('This is the foo ' + foo + ' and this is the bar ' + bar);
    
    }

    I can't run it as is because I need to pass in the values for foo and bar.  Keyword tests are no different, really.  You can set up default values for the parameters so you can run the test for development and debugging.  So, when you go to run the test, TestComplete is confirming that the default values you've set are what you want to use for the run.

     

    Now, if you don't want to do that, you could always create a script function or a keyword test to call your parameterized keyword test with parameters being set.  Then TestComplete will use those parameters and won't need to confirm whether or not you want to use the defaults.

     

    The other option would be to make all your parameters "optional".... set the optional flag on the parameters to true (checked) and you won't get that prompt.

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Unfortunately, no.  

     

    Think of it in terms of code.  If I write a function like this

     

    function yada(foo, bar){
        Log.Message('This is the foo ' + foo + ' and this is the bar ' + bar);
    
    }

    I can't run it as is because I need to pass in the values for foo and bar.  Keyword tests are no different, really.  You can set up default values for the parameters so you can run the test for development and debugging.  So, when you go to run the test, TestComplete is confirming that the default values you've set are what you want to use for the run.

     

    Now, if you don't want to do that, you could always create a script function or a keyword test to call your parameterized keyword test with parameters being set.  Then TestComplete will use those parameters and won't need to confirm whether or not you want to use the defaults.

     

    The other option would be to make all your parameters "optional".... set the optional flag on the parameters to true (checked) and you won't get that prompt.

    • gdave's avatar
      gdave
      Regular Contributor

      Thanks, setting the optional flag worked !!