SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Multiple windows

    In the Java app I am testing there can be multiple windows with differing captions.
    Captions could be:
    fred [structures]
    lucy [structures]

    I have one declaration for all these windows with the tag as follows:
    tag "*?structure?"

    This works fine, as long as I only have one
    window open at any time.

    However, I need to have multiple windows open and switch Silk Test's attention between them.
    I have a plan. It is this:
    Set the agent option thus,
    Agent.SetOption (OPT_VERIFY_UNIQUE, FALSE)
    then iterate over all windows, testing against the window caption. Once I have my window I could then set it active and proceed as normal.
    My problem is this. These windows have no parent, so I cannot use parent.GetChildren().
    How can I get Silktest to collect all open windows into a list, or is there a way of making Silktest tab between them...?


    ------------------
    Tempus fugit, Carpe Diem, et al

  2. #2
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Multiple windows

    To address the top-most window the declaration of the object could use an index like this:

    "*?structure?[1]"

    to directly make one of the specific windows active you could do the following:
    Directly referring to the specific name of the window using dynamic instantiation like this will set that window to be the topmost window and then from that point on in your testcase you can refer to the window by it's generic name that you have where the tag is "*?structure?"


    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Multiple windows

    Thanks for that.
    It solved half my problem.
    Let's say I have two windows:
    JavaMainWin("fred ?structure?")
    JavaMainWin("barney ?structure?")
    and that 'fred' is active.
    JavaMainWin("barney ?structure?").SetActive()does not make 'barney' active.
    To make 'barney' active I actually have to physically minimize 'fred'
    JavaMainWin("fred ?structure?").Minimize()
    then something like:
    flintstoneCharacter.Bowl.Click() will work on
    the 'barney' window and not on the 'fred'.
    While this allows me to do what I want to do, it is not very elegant and so my question is this:
    Why doesn't JavaMainWin("barney structure?").SetActive() make 'barney' active.
    Yabba Dabba dooooooo......?


    ------------------
    Tempus fugit, Carpe Diem, et al

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

    Re: Multiple windows

    Why doesn't JavaMainWin("barney structure?").SetActive() make 'barney'
    active.


    The reason is that the tag already matches the top app' so there's no need for Silk to initiate a change.

    The use of dynamic tags here seems unnecessarily repetitive but I'll assume that their use is strictly for illustrative purposes here.

    Why not consider creating a class to support the common characteristics of the Flintstone crew, declare each individual using their unique captions as tags, then call each of them by their first name?

    You would only need to index them if you allowed or required that there be two Freds (for example). You shouldn't do that however since Dino would get confused.

    However, if Dino is smarter than the average mutt, you'd need to carefully mimic the op' systems task-sequencing to avoid losing track of which Fred your talking to.

    As a physical example here, an Alt-Tab will always 'SetActive' to the previous task, however an Alt-Tab-Tab will jump to a third task if one exists. At that point the distinction between Freds is lost.

    To extend the indexing even further you could support the population with a list, define a single Flintstonian instance and use the [x] syntax to talk to anyone without knowing their name.

    John



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

  5. #5
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Multiple windows

    Damn.... you're right... silly of me.

    But it would be nice if you could get Silktest to cycle through all windows which match the tag, checking against the caption, rather than have to declare lots of windows with the caption in the tag.



    ------------------
    Tempus fugit, Carpe Diem, et al

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

    Re: Multiple windows

    Me thinks you bein' a bit lazy now!

    You don't have to declare them. Just put them into a list and create one or more instances dynamically.

    Or replace the Flintstonian instances' tag with a function that define who you want to talk to at that moment. (Big-time assumption here that local variables for Wilma won't affect Fred.)


    John



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

  7. #7
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Multiple windows

    OK, increment my idiocy counter and decrement the clever...
    I get the second point and like it too, but
    the first point is elluding me:
    "You don't have to declare them. Just put them into a list and create one or more instances dynamically"
    Put what into a list... all currently open windows...? Please advise

    ------------------
    Tempus fugit, Carpe Diem, et al

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

    Re: Multiple windows

    You can use a constructor to create instances as an alternative to textually declaring them with window blocks. The idea behind the list was to allow you to define and track the cast of characters.

    At a basic level you'll end up defining just one window variable to hold the window reference for each character. At a general level - ie: Flintstonian - you'll only have one. In all cases a constructor fills in the characteristics of the instance.

    The advantage here is that you don't have to address "Fred", or any other character directly anywhere in your test suites where the shared characteristics of (or operations on) a 'Flintstonian' instance can reasonably be substituted.

    The tracking of who has input focus (mentioned earlier with the index '[x]' syntax) can then become part of an implied low level routine that is shared by all. (In other words, once you've written it, you'll never revisit that code again.)

    John


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

 

 

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 07:16 PM.

Copyright BetaSoft Inc.