Forum Discussion

fayrehouse's avatar
fayrehouse
Frequent Contributor
12 years ago

More Parameter P(a)rob(a)lems!

All,



I'm a bit baffled here, as I'm sure this was working for me the other day!



I have a script function that takes 5 string params - 4 of which are optional, so a call might look like:



SelectDetails ("Param1","","","","")



I'm calling this function via "Run Script Routine" in a keyword test. By default, variables are Variants. if I click the "..." button for any of the 4 params, and change the type to String, and click OK - it looks right - but if I click "..." again, it has defaulted back to Variant! It's only if I enter a value does it remain as a string.



Can someone please advise what I can do here - if I leave it as variant - then the code actually (calling the Keys method) tries to type in "UNDEFINED" in one of hte fields! NOT GOOD!



As I say - I'm sure the other day I was able to set an empty string - but seemingly not now!



Help?!?



4 Replies


  • Hi Steve,


     


    I can call the function with several parameters from a keyword test on my computer. I use TestComplete 9.31. Please make sure that you are using the latest TestComplete version.


     


    If this doesn't help, please zip your entire project suite folder and post the archive here so that we could investigate it.


     

  • fayrehouse's avatar
    fayrehouse
    Frequent Contributor
    Hi Tanya,



    Calling the function with multiple parameters isn't the problem - it's if any of them are undefined... 



    Eg if I supply a value for the 2nd parameter of "myteststring" - then TC recognises it as a String variable, and "myteststring" gets entered into our AUT. However, if I then leave delete "myteststring" from the definition of the 2nd parameter, TC reverts it to a Variant - and when I run the test, TC enters "UNDEFINED" into the AUT! 



    I've found a workaround where in each function I can do "paramname = aqConvert.VarToStr(paramname)" .... but this isn't ideal!



    I've no objection to sending a zip of our test project, but I would guess that for NDA type reasons my employers would not want me posting it on a public forum... I believe we are in the process of renewing our support license - maybe I should chase that and raise a support call, referencing this thread?





  • fayrehouse's avatar
    fayrehouse
    Frequent Contributor
    Sorry, meant to say I'm using 9.31.3889.7



    :) Thanks again :)

  • Hi Steve,


     


    I've finally reproduced the issue. Our R&D team will fix it in one of the future updates.