SPONSORS:






User Tag List

Results 1 to 10 of 10
  1. #1
    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)

    Changing captions on split screens.

    Scenario:
    DialogBox caption = Dispatch
    consisting of a listbox containing approximately 20-25 items. Choosing 4 or 5 of the items forces a split screen where Screen-A has the caption "Dispatch:1" and Screen-B has the caption "Dispatch:2". The top 4-5 lines of the dialogs are the same except for their captions. The contents below those lines are completely different (grids, textfields, etc.).
    You can close any of these dialogs and when you invoke the dialog again, you won't see
    the caption "Dispatch" any longer. From here on your dialog's caption is either "Dispatch:1" or "Dispatch:2". The only way you'll get the caption "Dispatch" again is to exit the application and rerun it again.

    Question:
    Besides the use of
    Agent.SetOption(OPT_VERIFY_UNIQUE_FALSE), how would you deal with this issue, especially in your Windows Declarations?

    Thanks.


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

  2. #2
    Member
    Join Date
    Oct 2001
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Changing captions on split screens.

    If I understand the problem, you could declare two windows in the frame. Dispatch which uses "Dispatch" & "Dispatch:1" as its tag and Dispatch2 which uses "Dispatch:2". This way you should be able to manipulate both quite safely.

    Hope this helps,

    Paul

    ------------------
    Paul Tucker
    Merit AT
    www.merit-at.com
    Paul Tucker
    Merit AT
    www.merit-at.com

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

    Re: Changing captions on split screens.

    You could declare a subclass of DialogBox. The subclass contains all the common controls (or, if you prefer, a superset of all controls from the three dialogs). Then declare three windows of that subclass, adding any dialog-specific controls (if necessary) to the window declarations.

    I don't know if you are finding that the parentage of these dialogs is changing. If so, you could always address that with ActiveApp. A few SilkTest versions ago, I noticed that parent statements don't get inherited properly, so you have to repeat them. Don't know if this still happens, however.

    AG

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

  4. #4
    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: Changing captions on split screens.

    Thanks!
    Basically, I am doing what Paul is suggesting. The problem with it though is that my testcases have the "Dispatch" all over as in "Dispatch.Ok.Click ()" and everything will work fine until one of the options splits the screen into "Dispatch:1" and "Dispatch:2". From here on, all testcases containing the "Dispatch." will fail unless I exit the application and restart, which sometimes does not make sense since shutting and restarting this application (including the login) takes time.


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

  5. #5
    Member
    Join Date
    Oct 2001
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Changing captions on split screens.

    Gilbert,

    What error are you getting in SilkTest when the tests fail? From your description what you are doing should work because SilkTest should not match a tag "Dispatch" with a caption "Dispatch:1". If you can put the frame up and the error I would be more than happy to take a look.

    Also, check that the tag "Dispatch" does not have any wildcards.

    Paul

    ------------------
    Paul Tucker
    Merit AT
    www.merit-at.com
    Paul Tucker
    Merit AT
    www.merit-at.com

  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: Changing captions on split screens.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by ptucker:
    Gilbert,

    What error are you getting in SilkTest when the tests fail? From your description what you are doing should work because SilkTest should not match a tag "Dispatch" with a caption "Dispatch:1". If you can put the frame up and the error I would be more than happy to take a look.

    Also, check that the tag "Dispatch" does not have any wildcards.

    Paul

    <HR></BLOCKQUOTE>

    Paul,

    The contents of the 3 windows I declared are basically the same. The captions are different. When I created my testcases, everything related to the Dispatch window starts with "Dispatch." as in "Dispatch.Cancel.Click ()" or "Dispatch.Field1.SetText ("abc")". All these testcases will run okay except when the split screen is encountered. Then the error will say something like "Dispatch not found" since now the two windows are "Dispatch:1" and "Dispatch:2" and you won't see "Dispatch" anymore unless you exit the AUT. If I use the wild card in the tag as in "tag "Dispatch*", then the error you'll encounter is "Dispatch window is not unique".
    So, without exiting and restarting the application which resets the caption to only "Dispatch", the work-around I did is to use the do...except where the do has all the "Dispatch." stuffs and the except containing the "Dispatch:1" or "Dispatch:2" stuffs which does not look like a clean work-around. The other work-around is to set the AgentOption OPT_VERIFY_UNIQUE to FALSE which should work with just the one window declared using the wildcard.
    Additional info:
    The AUT (a huge one) is written in Delphi and of course, full of Custom Windows where even the very normal use of RadioButtons for handling the Yes or No prompt is done either as a) bitmaps that look like pushbuttons where if you click on a button, this button changes to a depressed picture or b) they use a drop down list. The AUT only runs in Windows platforms yet the programmers, when asked, will say "this is not a Windows application".




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

  7. #7
    Member
    Join Date
    Oct 2001
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Changing captions on split screens.

    Gilbert,

    What you describe is correct. If your tests reference Dispatch which has a tag Dispatch, but the actual caption of the window is Dispatch:1 (after they have split) then SilkTest will not find it.

    Instead of declaring all three windows, only declare two - Dispatch and Dispatch2. The declaration for Dispatch should be:
    DialogBox Dispatch
    multitag "Dispatch"
    "Dispatch:1"

    and Dispatch2 should be:
    DialogBox Dispatch2
    multitag "Dispatch2"

    If you do this, then any calls to Dispatch in your script will always find Dispatch or Dispatch:1. If you need to go to the second window, your script should say Dispatch2.

    Good luck,

    Paul

    ------------------
    Paul Tucker
    Merit AT
    www.merit-at.com
    Paul Tucker
    Merit AT
    www.merit-at.com

  8. #8
    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: Changing captions on split screens.

    Thanks again for your help Paul!
    But it still does not give me that "clean" solution. Maybe this example would help.
    - Invoke Dispatch window for the 1st time and caption shows "Dispatch"
    - select an item from the dropdown list causing a split screen. Now the captions are "Dispatch:1" and "Dispatch:2".
    - if you close Dispatch:1 window, all Dispatch windows will have the caption "Dispatch:2" since this is the last one you have active on the screen. If you close Dispatch:2 from the split screen, then all Dispatch windows from here on will have the caption "Dispatch:1".
    This means that if I ended up closing "Dispathc:1" (which sometimes is not the case if you need to do work on the screen showing "Dispatch:2", then all my testcases starting with "Dispatch." will fail. All the screens that shows the plain "Dispatch" caption is now replaced with either "Dispatch:1" or "Dispatch:2" depending on which one was closed last unless you exit the AUT, then all goes back to normal showing "Dispatch" only.

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

  9. #9
    Member
    Join Date
    Oct 2001
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Changing captions on split screens.

    Gilbert,

    Now I see your problem. I would suggest having only one window declaration and writing a string function to give you the tag. A function something like this should work (forgive me, I don't have Silk here so it may not be quite right):

    string GetDispatchTag ()
    select
    case DialogBox("Dispatch").Exists()
    return ("Dispatch")
    case DialogBox("Dispatch:1").Exists() && DialogBox("Dispatch:2").Exists()
    DialogBox("Dispatch:2").Close ()
    return ("Dispatch:1")
    case DialogBox("Dispatch:1").Exists()
    return ("Dispatch:1")
    case DialogBox("Dispatch:2").Exists()
    return ("Dispatch:2")
    default
    raise 1, "Dispatch could not be found"

    What this should do is set the string in the tag to the correct caption and close one of the two windows if they both exist. The window declaration would be
    DialogBox Dispatch
    tag GetDispatchTag ()

    The only limitation on this is that the recorder will not recognise the window as it does not run any code.

    Paul


    ------------------
    Paul Tucker
    Merit AT
    www.merit-at.com
    Paul Tucker
    Merit AT
    www.merit-at.com

  10. #10
    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: Changing captions on split screens.

    This looks like it's going to work Paul.
    Thanks again!
    I'll just experiment on how to handle the split windows since it's not "Dispatch:2" that needs to be closed.
    Sorry, I forgot to mention that when the split screen shows up, the contents of Dispatch:1 and Dispatch:2 windows are different. Closing Dispatch:2 will give you Dispatch:1 each time you invoke Dispatch again and closing Dispatch:1 will give you Dispatch:2 until you encounter another split screen. Then it's the same process from there.


    ------------------
    Paul,

    The solution you gave me really works well.
    When the split screens show up, all I have to do is check which one is Active then either maximize it or or close one of the windows.

    Thanks a lot!
    Gilbert


    [This message has been edited by Gilbert (edited 04-11-2002).]

 

 

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.