SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple Question #2

    How do you execute the main () function of a script from a testplan (.pln) file?

    2640 points to the winner!


  2. #2
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Simple Question #2

    My simple answer to your simple question.

    In your TestPlan:
    1.0 To execute your Main () function
    script: script1.t
    1.1 Call your function
    testcase: Main ()


    In your Test Script: (script1.t)

    Main ()
    test1 ()
    test2 ()
    test3 ()


    testcase test1 ()
    -- code here

    testcase test2 ()
    -- code here

    testcase test3 ()
    -- code here


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

  3. #3
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Simple Question #2

    Gilbert wins the 2640 points. You CAN call a main or other function from a testplan. A main is just another function, just like a testcase.

    Minor note: The () after the main is not needed.

  4. #4
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Simple Question #2

    I think it is implied that main function is written like this main(), but since it's mandatory for most script they just made it so it works without the "()". My 2 cents on it.

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

  5. #5
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Simple Question #2

    GK,

    Segue teaches use of the testcase keyword without the ().

    See the Segue course materials.

    John

  6. #6
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Simple Question #2

    Hmm...more Simple Questions are popping up but, I have not received the points for winning Simple Question #2

    ...just when I thought I could get that brand new car already...

    How 'bout just giving those Simple Questions including their Answers already then letting others add to the Answers if they have any?
    (since the bonus points seem to be useless)


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

  7. #7
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Simple Question #2

    Gilbert, the points for #2 are yours. Keep them someplace very safe.


  8. #8
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Simple Question #2

    Thanks John!
    I shall go to my bank today and rent a Safe Deposit box for those Green bonus points I've won!


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

 

 

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 04:11 PM.

Copyright BetaSoft Inc.