SPONSORS:






User Tag List

Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    May 2001
    Location
    New Delhi , India
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sync. problems in SilkTest!!!

    Hi,

    In my 4Test script I am supposed to wait till a particular window exists and then proceed ahead in the testcase. But , SilkTest goes on infinely in the Exists loop and does not come out of it , unitl the script is aborted!

    I am using the following code:

    While ( Dialog.Exists ())
    {
    // do nothing until it exists.
    }

    The problem is SilkTest doesn't seem to come out of this loop and this goes no infinetly , although the window does not exists now. I am not able to make any check for ChildWindows as well , as the ChildWindow name is dynamic and I can't check for it for each and every run of the script.


    A not so good workaround would be to put a Sleep ( n ) statement , but that increases the amount of time taken by the script.

    Any ideas on how to come about this problem!

    Regards,

    Grover.

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

  2. #2
    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: Sync. problems in SilkTest!!!

    You can place a value in the parens of the Exists method to tell it how long to wait for the particular window or object to become visible.

    e.g. While ( Dialog.Exists (15)), which will wait 15 seconds.

    A better way would be to use a while loop from the negative side. Something like:

    integer i
    while !(Dialog.Exists()) && i < 60
    Sleep (1)
    i++

    That way, there is a condition in your code that will eventually exit. If the dialog doesn't appear withing a minute (+/-) the script will move on and do whatever you direct next.


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

    Re: Sync. problems in SilkTest!!!

    Your code is too slow. Your better off to finish this loop by knowing in advance what are the ways that can close your dialog then check for Exists().

    Also sometimes silk doesn't recognize stuff accuratly, so silk might think your dialog still exists. One way for you to check if your dialog really exists or not do the following.

    Anyhow you can play with transcipt thing, you can run most of the stuff in it.

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


    [This message has been edited by GodKnows (edited 06-07-2001).]

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    NY,NY,USA
    Posts
    103
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Sync. problems in SilkTest!!!

    Shouldn't it be

    While !Dialog.Exists ()


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

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

    Re: Sync. problems in SilkTest!!!

    Hi!

    I'm new at the SilkTest game, but here's a thought.

    Some programs define objects at startup, & these objects remain in memory until the program closes. Is it possible that your dialog is such an object? Would such an object exist all the time so far as SilkTest is concerned? Would the IsVisible test be more appropriate?

    Hope this helps.

    sm

  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: Sync. problems in SilkTest!!!

    Try adding in your while loop a GetActive () followed by Printing of what the active window is to see if the "Dialog" you are expecting to exist really exist.
    You mentioned "dynamic" so you may also want to check the tag you used for this dialog in your Windows declaration.
    Have you tried checking for the another control/object in this dialog whether it exist rather than checking for the caption or title of the dialog?
    Debug time.....

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

  7. #7
    Junior Member
    Join Date
    May 2001
    Location
    New Delhi , India
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Sync. problems in SilkTest!!!

    Hi All,

    Thanks for the advices , script is now succesfully checking the existance of the dialogs , I used GetCloseWindows method and the GetNextCloseWindow to come around this problem.

    Thanks once again.

    Regards,
    Grover.

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

  8. #8
    Member
    Join Date
    Nov 2000
    Location
    Tampa, FL USA
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Sync. problems in SilkTest!!!

    have you tried the GetCloseWindows method or the GetNextCloseWindow method?? If you use the first method, you can then parse the list of windows to see if your dialog box exists. The second method will tell you which window is currently on top.

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

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

    Re: Sync. problems in SilkTest!!!

    janek:

    Interesting trick, I like it

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

  10. #10
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Sync. problems in SilkTest!!!

    Scott Murray: The Exists() method of 4Test classes does not check for an object's existence in the ordinary OO sense (which is what you seem to be thinking). It checks to see if the window (that the 4test object represents) is in existence in your application under test.
    The differences between the way OO is used in 4Test and the way OO is used in normal programming languages is a bit confusing at first, but you soon get the hang of what they're doing with it.

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

 

 

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

Copyright BetaSoft Inc.