SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Guest

    Identifying Windows with the same caption

    How do I identify multiple windows with the same caption?
    I'm running an application under the browser and I have multiple windows with no caption (Netscape only).

  2. #2
    Guest

    Re: Identifying Windows with the same caption

    You can identify each window uniquely given that each window has at least a unique component.
    For example: One window may have a button with the tag ''Save As'' and another with the tag ''Save''. To uniquely identify these windows, you need to modify the tag manually to point to the unique component.
    In this case: Window 1 will have the tag of ''[BrowserChild]#1/[Button]Save As/..''. Window 2 will have the tag of ''''[BrowserChild]#1/[Button]Save/..''. The ''/..'' at the end brings control back to the window level. So this solution enables Silk to look at the components of each window when identifying them.
    Please refer to page 64 of the Silk 1.0 User's Guide for more info.


  3. #3
    Guest

    Re: Identifying Windows with the same caption

    What about if I have two identical dialog boxes, and the only thing that different about them is that one got a Custom Win inside it
    Example :
    [-] window DialogBox SomeName
    [ ] tag ''test''
    [ ] parent SomeparentWindow
    [-] PushButton OK
    [-] multitag ''OK''
    [ ] ''$2''
    [-] CustomWin ThereMustBeAtLeastOneName
    [-] msw multitag ''[MSOUNISTAT]Some text goes here''
    [ ] ''[MSOUNISTAT]$-1''

    I have tried the following but unfortinitly it didn't work:

    tag ''[DialogBox]test/[CustomWin]Some text goes here/..''
    and I have tried this one too;
    tag ''[DialogBox]test/[CustomWin][[MSOUNISTAT]]Some text goes here/..''

    and neither one of them worked.

    Note: By the way, thanks for your previous reply.

  4. #4
    Guest

    Re: Identifying Windows with the same caption

    > tag ''[DialogBox]test/[CustomWin]Some text goes here/..''
    >
    Have you tried

    tag ''[DialogBox]test/[CustomWin]#1/..''

    ?

    If your window has only one CustomWin element in it, I would
    think the tag I give *should* be recognized. You might have
    trouble recognizing the window *without* the CustomWin
    element, though.
    You might try

    tag GetFunkyWinTag ()

    combined with a subroutine:

    STRING GetFunkyWinTag ()
    if SomeName.CustomWin(''#1'').Exists ()
    return ''[DialogBox]test/[CustomWin]#1/..''
    else
    return ''[DialogBox]test''

    as an alternative. Others will probably have more elegant solutions,
    though.
    --
    Clayton Colwell
    Software Tester/Developer
    Motorola, Austin


  5. #5
    Member
    Join Date
    Dec 1999
    Location
    Rochester, NY, USA
    Posts
    52
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Identifying Windows with the same caption

    The problem related to the tag not working (which is almost correct) is that for CustomWin's you do not use [CustomWin] as is done with other objects in the tag. So "/[MSOUNISTAT]Some text goes here" would identify that child window.

    The tag should like this:
    tag "[DialogBox]test/[MSOUNISTAT]Some text goes here/.."




    ------------------
    Andy Bachman
    Andy Bachman

  6. #6
    Member
    Join Date
    Apr 2001
    Location
    Akron, Ohio, USA
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Identifying Windows with the same caption

    User Bill Watkins (wwaat@yahoo.com) posted:


    Hello all

    I am having trouble remebering the syntax for the tag statement that allows you differentiate between multiple window with the same caption using a unique object on the page.



    ie

    window BrowserPage Login

    tag "My Sample Tag"

    window BrowserPage AccountSummary

    tag "My Sample Tag"



    How can i if for instance that I have a HtmlTextField on the Login page distinguish based on that field that it is the login page.



    TYIA



    Bill Watkins
    Bill Watkins

    Quality Assurance Engineer
    ---------------------------------
    Bill Watkins
    QA Project Lead

  7. #7
    Senior Member
    Join Date
    Jan 2000
    Location
    Chicago, Illinois, USA
    Posts
    151
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Identifying Windows with the same caption

    I am not sure if it helps but if you have several windows open with same name you can set a different Title for each one with "user32.dll" function.


    something like this:
    [ ]use "msw32.inc"
    [ ]int hWnd

    [-] testcase SetTitle ()
    [ ]hWnd = DialogBox("Netscape")
    [ ]SetWindowText(hWnd, "WinName1")
    // bring next window into focus
    [ ]DialogBox("Netscape").SetActive
    [ ]hWnd = DialogBox("Netscape")
    [ ]SetWindowText(hWnd, "WinName2")

    etc...
    or
    while(DialogBox("Netscape").Exists())


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


    [This message has been edited by ademin (edited 04-12-2001).]

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

    Re: Identifying Windows with the same caption

    Ademin - can you explain what this function does here. Does it actually change the caption of the window? That sounds potentially very useful indeed.

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

  9. #9
    Senior Member
    Join Date
    Jan 2000
    Location
    Chicago, Illinois, USA
    Posts
    151
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Identifying Windows with the same caption

    I am really sorry for confusion. Instead of

    [ ]hWnd = DialogBox("Netscape")

    should be:

    [ ]hWnd = DialogBox("Netscape").GetHandle()

    Here is a qucik sample that works. I used Internet Explorer browser that defaulted to blank page.

    [ ]use "msw32.inc"
    [ ]int hWnd

    [-] testcase SetTitle ()
    [ ] //open four windows with same title
    [ ] SYS_Execute ("start iexplore")
    [ ] SYS_Execute ("start iexplore")
    [ ] SYS_Execute ("start iexplore")
    [ ] SYS_Execute ("start iexplore")
    [ ]
    [ ] //assign different title for each window
    [ ] MainWin("about:blank*").SetActive()
    [ ] hWnd = MainWin("about:blank*").GetHandle()
    [ ] SetWindowText(hWnd, "TEST1")
    [ ]
    [ ] MainWin("about:blank*").SetActive()
    [ ] hWnd = MainWin("about:blank*").GetHandle()
    [ ] SetWindowText(hWnd, "TEST2")
    [ ]
    [ ] MainWin("about:blank*").SetActive()
    [ ] hWnd = MainWin("about:blank*").GetHandle()
    [ ] SetWindowText(hWnd, "TEST3")
    [ ]
    [ ] MainWin("about:blank*").SetActive()
    [ ] hWnd = MainWin("about:blank*").GetHandle()
    [ ] SetWindowText(hWnd, "TEST4")
    [ ]
    [ ]


    [ ]
    [ ]
    [ ] //close each window with appropriate title
    [ ] MainWin("TEST1").Close ()
    [ ] MainWin("TEST2").Close ()
    [ ] MainWin("TEST3").Close ()
    [ ] MainWin("TEST4").Close ()

    It works with Dialog boxes also.




    [This message has been edited by ademin (edited 04-19-2001).]

  10. #10
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Identifying Windows with the same caption

    Where do you get the function SetWindowText().
    Is it from Win32 API or from Silk?

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

 

 
Page 1 of 2 12 LastLast

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 11:08 AM.

Copyright BetaSoft Inc.