SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jun 2001
    Location
    Berkeley, CA, USA
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Multiple instances of same window

    Try using a do...except loop.

    If you catch the window not unique error, you know you have more than one instance of the window.

    It should look something like this:

    BOOLEAN bLoop = TRUE

    while(bLoop)
    do
    window.SetActive()
    bLoop = FALSE
    except
    if (([EXCEPTION]ExceptNum())==E_WINDOW_NOT_UNIQUE)
    Agent.SetOption (OPT_VERIFY_UNIQUE, FALSE)
    window.SetActive()
    window.Close()
    Agent.SetOption (OPT_VERIFY_UNIQUE, TRUE)
    else
    reraise

    The condition to exit the while loop shouldn't be met as long as there is more than one window in existance.

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

  2. #2
    KS
    KS is offline
    Senior Member
    Join Date
    May 2001
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Multiple instances of same window

    Is there a way to close multiple instances of a same window leaving only one. My app has a login window and I want to make sure that there is no other instance of it exists except one. How can I do that?

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

  3. #3
    KS
    KS is offline
    Senior Member
    Join Date
    May 2001
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Multiple instances of same window

    Thanks Bruce
    I am running 5.5 and looks like 'OPT_VERIFY_UNIQUE, FALSE' is not doing much the follwing are the actual agent call notice SilkTest sets 'OPT_VERIFY_UNIQUE, FALSE' and still complains about window not being unique. What i am i doing wrong?

    [ ] WorkshopLogin.SetActive ()
    [ ] Agent.SetOption (OPT_VERIFY_UNIQUE, FALSE)
    [ ] WorkshopLogin.SetActive ()
    [ ] *** Error: Window WorkshopLogin' is not unique


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

  4. #4
    Member
    Join Date
    Jun 2001
    Location
    Berkeley, CA, USA
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Multiple instances of same window

    I'm not running 5.5 yet, so I can't verify whether that option is broken or not. It looks like you set up everything correctly.

    There is one more thing you can try. Tags support index notation. Create a copy of your window in the include file and append [2] to the caption tag.

    Set up a while loop to close the second window whenever it is found and all but one instance should be closed.

    According to the 5.0.3 help file, this should work even if OPT_VERIFY_UNIQUE is set to TRUE.

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

  5. #5
    Senior Member
    Join Date
    Sep 1999
    Location
    San Jose,CA,USA
    Posts
    340
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Multiple instances of same window

    Two things. BEFORE you log in kill all active workshop windows. Also it may be preety easy to do that. You can probably generate your own window identifier on the fly via a loop, and kill it as you encounter it. (much like what Bruce went into just before)

    Here is an uncompiled untried snippet for you to look at:


    If this seems really obscure feel free to
    attach the frame tag identification of workshop?


    ------------------
    "Smoke me a kipper, I'll be back for breakfast!"
    Sincerely
    Richard Weth
    Sr. QA Engineer
    mailto:rick_weth@yahoo.com




    [This message has been edited by rick_weth (edited 07-02-2001).]
    Smoke me a kipper, I'll be back for breakfast!
    Sincerely
    Richard Weth
    Sr. QA Engineer

  6. #6
    Member
    Join Date
    Jan 2001
    Location
    Westborough, mA, USa
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Multiple instances of same window

    You can have a TestCaseEnter() function which you have to write a code which will close all the MainWins if they exist and then you can invoke ur application.
    Hope this helps

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

 

 

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 05:36 PM.

Copyright BetaSoft Inc.