SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I\'m Unable to Pass Variables to My Derived Invoke Method

    I'm trying to have my derived Invoke() methods for several applications in a product suite to EITHER accept variables or not, as follows:

    - I have a common function that I call when I want to start any of the applications in my product suite
    - In order to test logins without a username or password, I spec the args NULL and make them optional
    - I set a boolean flag that specifies whether I'm passing Username & Password pairs. If I'm not, then I want my derived Invoke() to use default values to login

    I need help getting it to work!

    - Is the "NULL optional" thing redundant?
    - I inserted print statements into the derived Invoke() to debug and they all print 'NULL'. Why doesn't my derived Invoke() method receive the arguments that it gets passed???

    ------------------

  2. #2
    Senior Member
    Join Date
    Jun 1999
    Location
    Fremont, CA, USA
    Posts
    355
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I\'m Unable to Pass Variables to My Derived Invoke Method

    Is the "NULL optional" thing redundant?
    Yes. Just have "optional". If no data is passed, the default is NULL. Having the parameters as "NULL optional" is setting them to NULL even when data is beign passed in.



    ------------------
    David Genrich
    david@e2Open.com
    david_kim@usa.net

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I\'m Unable to Pass Variables to My Derived Invoke Method

    David,

    Thanks for clearing that up. It appears the online help in SilkTest is misleading:

    looked up NULL arguments...

    "null -- Optional. Indicates that the argument can contain a NULL value. If omitted, the default is that the argument cannot be NULL. SilkTest raises an exception if an argument you have not explicitly allowed to be null is NULL on entry to a function."

    and the example...

    "ProcName (BOOLEAN b, STRING sName NULL, INTEGER iStart optional)
    if (sName == NULL)
    sName = "Smith"
    if (iStart == NULL)
    iStart = 0
    Print (b, sName, iStart)"

    It makes it frustrating when you follow the help down the wrong path!

    Meanwhile, I eliminated the 'NULL' statements from my function and method definitions and I still cannot successfully pass variables to my Invoke() method. There has to be something basic I'm missing here...

    ~ Fred

    ------------------

  4. #4
    Senior Member
    Join Date
    Jun 1999
    Location
    Fremont, CA, USA
    Posts
    355
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I\'m Unable to Pass Variables to My Derived Invoke Method

    I am not sure why you can't get it to work. Looking at your sample, everything seems fine (other than the "NULL optional" that you have since replaced with just "optional").

    Send my your actual code and I'll take a closer look at it (david.genrich@e2open.com)



    ------------------
    David Genrich
    david@e2Open.com
    david_kim@usa.net

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: I\'m Unable to Pass Variables to My Derived Invoke Method

    I was calling the global function from a testcase, then the global function called the Invoke method. I failed to set the testcase to 'appstate none', so it called invoke before starting the testcase...

    I knew it had to be something obvious!

    ~ Fred

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:32 PM.

Copyright BetaSoft Inc.