SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jun 2003
    Location
    Brisbane
    Posts
    70
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    win_exists - get active window issue

    When my app starts up I then eitehr "window A" is displayed or "window b" is displayed. I need to an additional step if window A is displayed. Currently I am doing

    if ( win_exists("winA", timeout) do A

    do B


    problem is that win_exists gives exception is winA does not exist.


    I tried getting name of active window and mapping it to gui map and get window description. But that didnt work as when you get active window you cant specify a timeout. My application can take a while to start and this check is the first thing that needs to be performed
    I have done appropriate things in exception handler but I have to wait for timeout (which is long) and restart the test.

    Is there is another way to handle this problem?

    [ 01-19-2004, 05:26 PM: Message edited by: anmol_khanna ]

  2. #2
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: win_exists - get active window issue

    Try doing...

    if(win_exists("winA", timeout) == E_OK)
    {
    # do A
    }
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)

  3. #3
    Member
    Join Date
    Jun 2003
    Location
    Brisbane
    Posts
    70
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: win_exists - get active window issue

    Originally posted by Charles Reace:
    Try doing...

    if(win_exists("winA", timeout) == E_OK)
    {
    # do A
    }
    <font size="2" face="Verdana, Arial, Helvetica">Thats what i did. didnt mention that in post. It has same problem . I dont want it to wait for timout period.
    also it gives exception message in win_exists so the above does notw work. I tried doing

    loop
    wait(3);
    win_get_info ("{class:window, active: 1}","handle",WindowHandle);
    win_get_desc("{class: window, handle:" & WindowHandle & "}","","","",WindowDescription);

    rc = GUI_map_get_logical_name (WindowDescription,"", ActiveWindowName, GUI_file );
    #if (ActiveWindowName=="Use this Login"&#0124;&#0124; ActiveWindowName == "Debtors Invoice/Credit Note Entry") break;
    }
    but it doesnt give active window on screen. It gives active window in gui map which is incorrect. Any suggestions?

  4. #4
    Senior Member
    Join Date
    May 2003
    Location
    Austria
    Posts
    1,480
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: win_exists - get active window issue

    3 hints:

    1. Try win_highlight("winA", 0) instead of win_exists, this is the fastest way of checking if a window or object exists.

    2. If you want to use win_exists without waiting the timeout length, do not add the second param - just use win_exists("winA"). If you enter a second param - e.g. win_exists("winA", 0) - WR will add the default timeout (Settings>General Options>Run) to the value in your second param.

    3. Try to turn off "Break when Verification fails" in menu Settings>General Options>Run. I assume that this caused the exception messages. Note, that if you turn off this setting, you will have to program the exception handling in your scripts (e.g. what to do if a window does not appear, ...).

    Regards,
    Juergen

  5. #5
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: win_exists - get active window issue

    Originally posted by bru:
    3 hints:

    [SNIP]

    3. Try to turn off "Break when Verification fails" in menu Settings>General Options>Run. I assume that this caused the exception messages. Note, that if you turn off this setting, you will have to program the exception handling in your scripts (e.g. what to do if a window does not appear, ...).

    Regards,
    Juergen
    <font size="2" face="Verdana, Arial, Helvetica">Forgot about that - I always have that as my default configuration. It does put the onus on the script writer to check for and handle missing windows/objects.
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.&lt;/i] (The Song of Roland)

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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:24 AM.

Copyright BetaSoft Inc.