SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    SQA Knight
    Join Date
    Sep 2001
    Location
    Bangalore,India
    Posts
    2,549
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Testcasename passing thro variable

    Hi,
    Is it possible to give testcase name in the variable..? For example,
    testcase: LoginAsAdmin --->Standard statement. Can I give like below?
    testcase: {varTest} ---> where varTest variable contains the name "LoginAsAdmin"

    ------------------
    Thanks & Regards,
    Palani.
    Thanks & Regards,
    Palani.
    http://tips-testing.blogspot.com/index.html
    Quote: Donít hesitate to initiate!

  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: Testcasename passing thro variable

    Technically, no, a string can not executed (and a variable in your example would be a string).

    However, the string could be parsed and then executed.

    I have attached a function I wrote a while ago - Execute () for executing strings and returning the output (if any). It works with testcases, functions, and methods. I included split() as well, since that is called. I also included another function (which I didn't write, Str2Win() which is called by Execute() )


    The sExecuteString agrument it takes is the exact testcase/function/method to execute, including the opening and closing parentheses, and any parameters. By default, all parameters are treated as STRINGs unless you typecast them to be something else.

    Output is returned by the second variable, if given.


    So, for a test plan to execute a test case, you could do something like:

    This will execute the testcase GetBuildInfo (note that the () are required).

    Now, if you wanted to run a testcase with parameters:

    This will execute the testcase "MyTestCase", with parameters of:
    "testData", 50, TRUE

    All parameters other than the STRING must be typecast (the string can be typecast too if you want, but that is the default that is used if none is given).

    This can also be used for functions or methods - the variable just needs to be the full execution argument. Since Execute() is a function, it can be called from anywhere, just shown here in a Test Plan put in context of the question.

    *** I can not attach files - will only let me attach 10 files for the lifetime I am on this board (was on the board for ages). I pasted the code below.




    ------------------
    David Genrich
    david.genrich@e2open.com
    david@linuxpuppy.net

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

    Re: Testcasename passing thro variable

    Email me at david.genrich@e2open.com for the attachment if needed.



    ------------------
    David Genrich
    david.genrich@e2open.com
    david@linuxpuppy.net

  4. #4
    SQA Knight
    Join Date
    Sep 2001
    Location
    Bangalore,India
    Posts
    2,549
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Testcasename passing thro variable

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by davidgenrich:
    Technically, no, a string can not executed (and a variable in your example would be a string).

    However, the string could be parsed and then executed.
    <HR></BLOCKQUOTE>
    Hi davidgenrich,
    Thanks a lot for your reply. I'll work on this. If any clarifications needed, I'll mail to you or reply to this post....Okay.


    ------------------
    Thanks & Regards,
    Palani.
    Thanks & Regards,
    Palani.
    http://tips-testing.blogspot.com/index.html
    Quote: Donít hesitate to initiate!

  5. #5
    Senior Member
    Join Date
    Aug 2003
    Location
    NY
    Posts
    708
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Testcasename passing thro variable

    If that is possible, shouldn't the use of ArgListCall also be possible? I am not sure if this has been recently added and was not available in previous versions of Silk.

    Thanks and Regards,
    Harshil

 

 

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 12:38 PM.

Copyright BetaSoft Inc.