SPONSORS:






User Tag List

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Jul 2002
    Location
    Chennai
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Enhancement in Wait() method.

    We have written user-defined method for waiting for the browser child and some specific object in the browser child.
    The function sample is:
    wait(ANYTYPE wnd)
    {
    int count = 0
    while (!wnd.Exists() && count < MAX_WAIT_COUNT)
    { sleep(2)
    count = count + 1
    print("Sleeping for 2 seconds...")
    }
    }

    The problem we are facing using the above code is sometimes when we run the scripts over night the scripts don't get executed fully and the script stops in some testcases where it keeps on waiting for a window for a long time.
    How can we avoid this? Can anyone suggest any alternate code? If there is it needs to be of the same pattern as we use this function in all scripts. We are using Silktest 5.03 with IE DOM enabled.

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

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

    Re: Enhancement in Wait() method.

    The problem with time delays in general is that they tend to serially accumulate in long regression suites to the point where nothing seems to be happening in the application being tested for very long periods of time.

    First off I'd suggest that you drop the delay increment to 1/10th of a second (and multiply the wait limit by 10 to account for that adjustment). This ensures that Silk will always work as quickly as possible to complete the test run.

    Second I'd suggest that the time limit be a separate parameter to the call so that it can be customized to handle both fast and slow-appearing windows.

    Third, consider moving that functionality into the base SetActive() and Invoke() code instead of forcing the test coder to remember to apply it where it's needed. That way the support is isolated to the one and only place where it really matters.


    John


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

  3. #3
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enhancement in Wait() method.

    what is the value assigned to max_wait_count? seems you shouldn't get hung for any longer than that value allows.

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

  4. #4
    Senior Member
    Join Date
    Dec 2001
    Location
    Bozeman, MT, USA
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enhancement in Wait() method.

    whats wrong with the Browser.WaitForReady() method and then a Browser.Object.Exists(n) methods? You can put a number inside the Exists() method.

    ------------------
    Ryan McCullough
    Accelrys Inc.
    ryan@accelrys.com

    [This message has been edited by rmccullough (edited 11-11-2002).]
    Ryan McCullough
    RightNow Tech. Inc.

  5. #5
    Junior Member
    Join Date
    Jul 2002
    Location
    Chennai
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enhancement in Wait() method.

    We have set the MAX_WAIT_COUNT to 30.
    When we run the test scripts individually it runs fine but when we try to run them in a suite silktest executes a few testcases and then keeps waiting for a window even past the MAX_WAIT_COUNT count.

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

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

    Re: Enhancement in Wait() method.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by mustafah:
    when we try to run them in a suite silktest executes a few testcases and then keeps waiting for a window even past the MAX_WAIT_COUNT count.
    <HR></BLOCKQUOTE>

    If you abort the script by pressing shift-shift when this long delay is evident, where is the failing line for the "Script aborted by user" message ? Inside your wait routine or somewhere else?


    John


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

  7. #7
    Junior Member
    Join Date
    Jul 2002
    Location
    Chennai
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enhancement in Wait() method.

    When I abort the script by pressing Shift-Shift it ends inside the wait routine. Though the printed text "Sleeping for 2 seconds..." is displayed only a few number of times but if you see the elapsed time its over 1 hour.

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

  8. #8
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enhancement in Wait() method.

    Mustafa,

    Let's try something that should be unnecessary. I mean, your concept is valid, but let's come at it a different way...

    Rather than using the while loop let's change it to an "if"

    Ideally it should not make a difference, but who knows?



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

  9. #9
    Senior Member
    Join Date
    Dec 2001
    Location
    Bozeman, MT, USA
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enhancement in Wait() method.

    use a Timer instead of a sleep. Makes silk work as fast as possible while still keeping track of time.

    What line specifically is it failing on??

    ------------------
    Ryan McCullough
    Accelrys Inc.
    ryan@accelrys.com
    Ryan McCullough
    RightNow Tech. Inc.

 

 

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 08:56 PM.

Copyright BetaSoft Inc.