Forum Discussion

fayrehouse's avatar
fayrehouse
Frequent Contributor
11 years ago

Param defaults in scripted function for use in keyword test

Hi all,



Does anyone know if it is possible when defining a function in a piece of Jscript, to specify default values for the params - so that when you add a call to that function in a keyword test, the parameter dialog is already populated?



4 Replies

  • Hi Steve.



    I don't know this feature. Default values can be defined within your JScript function using  undefined parameters analysis, but this will not help to get the behaviour of TC you described.



    I can suggest to create fake KDT as set of templates: collect all the function calls you need, populate all the "default" values for parameters manually and then copy-paste function calls from this KDT into your real KDTs. This approach may look not handy enough but you may create different templates (set of parameters values) for the same JScript function.



  • yes I do agree and recommend this as a new feature.

    While calling a function having many fields, needs to be passed with values.

    Its a tedious job and having such feature will reduce the effort several folds.

    Thanks,
    Shrirang
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Guys,


     


    I have registered your request as a suggestion in our DB. Thanks!


     

  • fayrehouse's avatar
    fayrehouse
    Frequent Contributor
    Thanks Andrey - that *may* be an option - the situation here being I'm creating functions for... less technical testers to bolt together into whatever order for a test by test basis - I'd have to find out if this would benefit them or not.



    Meanwhile - perhaps Smartbear could consider this a feature request? :)