SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Feb 2002
    Location
    Cambridge, Massachusetts, USA
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Recognizing indows that appear with or without parent

    I haven't found the answer to this one anywhere in the Silk (5.03) documentation.

    The question is this: I have a window that appears sometimes with a parent and sometimes without one. I have not figured out any predictible way to know when one will appear and when the other will appear.

    I'd like to be able to handle this window regardless of whether it appears with or without a parent.

    What I'd like to do is something like this:

    multitag "[DialogBox]ParentOfWindowX/[DialogBox]WindowX"

    "[DialogBox]WindowX"

    so that Silk would recognize the window regardless of whether it has a parent or doesn't. Unfortunately this method hasn't worked so far. Maybe I don't have the right syntax, or maybe it just doesn't work this way?

    I did figure out an entirely different way of doing it by creating parent and no parent versions of the window and then checking for the existence of one or the other, determining which version of the window appeared and passing back the window name to the calling function, however this is quite clumsy compared to a multitag-type approach.

    Thanks for any suggestions about this.




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

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

    Re: Recognizing indows that appear with or without parent

    [B]Try:

    "~ActiveApp/WindowX"

    instead.


    John




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

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

    Re: Recognizing indows that appear with or without parent

    "~ActiveApp/WindowX" won't work, because it assumes that the window always has some parent or other. If the window sometimes has no parent at all, then that tag won't work properly.

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

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

    Re: Recognizing indows that appear with or without parent

    Good point, Vince.

    chimay,

    Can you post the results a Record/Window Tag for both cases?


    John


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

  5. #5
    Junior Member
    Join Date
    Feb 2001
    Location
    Portland, OR, USA
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recognizing indows that appear with or without parent

    You could try something like this:

    tag "../WindowX"
    Bill Hull
    QA Engineer
    Timberline Software
    www.timberline.com

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

    Re: Recognizing indows that appear with or without parent

    Use a function in place of a tag where the function will evaluate which windows are there and return the correct string form of the tag for the window that is there. THis won't help recording, but playback works good.

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

    Re: Recognizing indows that appear with or without parent

    On thinking about it, I think it might be possible by making the tag a method call.
    The trick is not in varying the tag, but that you can use the method call to reset the parent.
    Here is an example from my app, of the Exit dialog:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[-] window DialogBox ExitDialog
    [ ] // parent not set
    [ ] tag GetTag()
    [+] string GetTag()
    [-] if GetTestCaseState() == TCS_ENTERING
    [ ] // In TestCaseEnter, haven't yet found out the variable wAUT.BUILDNUMBER
    [-] else
    [-] if wAUT.BUILDNUMBER &gt; 1059
    [ ] SetProperty(&quot;wParent&quot;, wAUT)
    [-] else
    [ ] // leave the parent unset
    [ ] return &quot;Exit&quot;
    [+] PushButton OK
    [ ] tag &quot;OK&quot;
    [+] PushButton Cancel
    [ ] tag &quot;Cancel&quot;
    [+] StaticText AreYouSureYouWantToExit
    [ ] tag &quot;Are you sure you want to exit?&quot;</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">There is a bit of extra complexity in that example because the member variable BUILDNUMBER is only found out at runtime, during the course of TestCaseEnter.

 

 

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

Copyright BetaSoft Inc.