SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Junior Member
    Join Date
    May 2002
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting DefaultBaseState from inside a testcase

    Michael:

    I tried calling DefaultBaseState(). It didn't do anything. Could this be a function that someone at your site defined?

    ------------------
    Marc Sacks
    QA Engineer
    Cyphermint, Inc.
    msacks@cyphermint.com
    Marc Sacks
    QA Engineer
    Cyphermint, Inc.
    msacks@cyphermint.com

  2. #2
    Junior Member
    Join Date
    Sep 2001
    Location
    Fremont, CA
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting DefaultBaseState from inside a testcase

    There are many ways to do this. Not sure why DefaultBaseState () didn't work you.

    Appstates should have quotes around them, try SetAppState("DefaultBaseState")

    If that doesn't work, use SetBaseState ()

    Worst case, just create a new AppState based on the DefaultBaseState, then call the new Appstate inside the loop.

    Chris

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Location
    San Diego,CA,USA
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting DefaultBaseState from inside a testcase

    what did you expect it to do?

    if you call DefaultBaseState() that should haveworked.



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

  4. #4
    Junior Member
    Join Date
    May 2002
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting DefaultBaseState from inside a testcase

    Starting a testcase from DefaultBaseState is easy enough. However, I have a testcase that goes through loop, and I want each iteration of the loop to start at DefaultBaseState.

    I tried SetAppState(DefaultBaseState), but Silk didn't recognize DefaultBaseState as a real appstate, or so it said. Simply writing SetAppState() didn't do anything either.

    Is there a way to do this?

    ------------------
    Marc Sacks
    QA Engineer
    Cyphermint, Inc.
    msacks@cyphermint.com
    Marc Sacks
    QA Engineer
    Cyphermint, Inc.
    msacks@cyphermint.com

  5. #5
    Senior Member
    Join Date
    Dec 2001
    Location
    San Jose, CA
    Posts
    102
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting DefaultBaseState from inside a testcase

    Simple. Just call

    DefaultBaseState()

    Michael

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

  6. #6
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting DefaultBaseState from inside a testcase

    ----------------------------
    <ib>I have a testcase that goes through loop, and I want each iteration of the loop to start at DefaultBaseState. </i/b>
    ----------------------------

    TO THE POINT:
    It's simple enough to just create a function that drives a loop to feed the necessary data to a testcase as parameters. That way you'll use the basestate you already have with virtually no effort at all.

    myloop()
    for x = 1 to ...
    test1(x)

    testcase test1(int x)
    ...

    A SLIGHT DIGRESSION:
    Realise that not everything needs to be defined as a testcase within Silk. In fact, the only time I use them is when I want reportability to the results file or need base state recovery.

    What ScriptEnter(), ScriptExit(), TestCaseEnter() and TestCaseExit() do is entirely up to what you've coded them to do. The default is that they do very little. (Step into them in debug mode sometime - press F7 when you hit the testcase definition line - to see what actually happens.)

    Defining a default base state is a coding convenience to drive your AUT to a predefined initial configuration. With appstates, its a nestable environment-setting wrapper. With it you can modify the existing state (whatever that may be) to reflect any special conditions you might need. The correct application of them depends on carefully appending the appropriate appstate name to each testcase() definition.

    appstate start_App basedon defaultbasestate
    // if app not running, start app
    ...

    Appstate Login basedon start_App
    // if app not logged in, login
    ...

    appstate open_xyzWindow basedon Login
    // if not open, open it
    ...

    appstate open_abcWindow basedon Login
    // if not open, open it
    ...

    testcase test1 open_xyzWindow
    // window xyz is now ready for business

    testcase test2 open_abcWindow
    // window abc is now ready for business

    Note the appstate dependency chain above. Testcase 1 and 2 couldn't care less how they got to their respective windows, they just start doing their work.

    The implied overhead of the above can be considerable so you must be careful about how those appstates are written.


    John


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

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

    Re: Setting DefaultBaseState from inside a testcase

    Defining these two functions.
    TestcaseExit()
    TestcaseEnter()
    So that when you enter and exit a testcase they will be called.

    Then you could call them when you want to, I assume.

    ------------------
    They will be called automatically.

    [This message has been edited by GodKnows (edited 08-16-2002).]

  8. #8
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting DefaultBaseState from inside a testcase

    I do not use testcases at all in my scripts, instead I open the browser at the beginning of my loop to the location I want it to start and close the browser at the end of the loop. By doing this I make sure that cached data is kept to a minimum. It also allows me to program my own recovery to known errors, and to set a default error handler that handles all other errors, records what the new errors are and basically allows my script to "learn" the application, thereby making a more robust script.

    MikeF

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

  9. #9
    Senior Member
    Join Date
    Jul 2001
    Location
    Westford, MA, USA
    Posts
    160
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting DefaultBaseState from inside a testcase

    MikeF --
    I don't want to open up a can of worms here and I'm sure you know your needs better than I do, but I definitely want to encourage new users who might be reading this discussion to absolutely use testcases, and absolutely automate such repetitive actions as opening and closing the browser if necessary before or after a loop.
    If you don't use testcases you are missing out on a lot of the power and flexibility of the product. Clearing the cache can be done in 4Test. You can set up your own recovery system that is appropriate to your AUT. You can set up your own error handling, including trapping new errors. All of this can be done if you use testcases, some of these things can be done a lot easier if you use testcases.
    Again, how you use the product for your situation is for you to decide. I just want to make sure others reading this discussion don't get confused and go down a very costly wrong path.
    AG

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

  10. #10
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting DefaultBaseState from inside a testcase

    Sorry

    MikeF

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

 

 
Page 1 of 2 12 LastLast

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.