SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Feb 2003
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Differentiating Identical Browser Page by Index?

    Hi there,

    I have a situation in which I need to open several IE browsers pointing to the same page. For instance, I want to open 3 IE browsers all pointing to the Google.com front page. Is there a way to tell the 3 browsers from each other? I mean are there runtime indices assigned to each browser window?

    Thanks!

    David

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Differentiating Identical Browser Page by Index?

    Unfortunately, the one on top is Browser, the one behind it is Browser2. If you make Browser2 active (Browser2.SetActive ()), then it's Browser because it's the active one.

    How do you feel about juggling?

    - Dave
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  3. #3
    Member
    Join Date
    Feb 2003
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Differentiating Identical Browser Page by Index?

    Thanks!

    I got the toggle between 2 identical browser pages to work. Is there a way to tell which browser is which when we have 3+ browsers?

    I believe Mercury's QTP assigns an index to each browser that's opened. The script can go to the particular browser by the default index. Is there a similar feature in SilkTest?

    Thanks.

    David

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Differentiating Identical Browser Page by Index?

    Unfortunately, it all depends on where they are in the order of dominance. Browser will be the one closest to being active, Browser2 will be the next one closest to being active, and, well, they never declared Browser3, but you could see it by saying, for example, MainWin ("$explorer6_DOM[3]") (if you're using IE6 DOM).

    If you want to see what SilkTest sees as running, do this:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[-] testcase foo () appstate none
    [ ]
    [ ] ListPrint (Desktop.GetChildren ())</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Additionally, if you have 3 browsers running, the following will work:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> [ ] Print (MainWin (&quot;$explorer6_DOM[1]&quot.Exists ()) // TRUE
    [ ] Print (MainWin (&quot;$explorer6_DOM[2]&quot.Exists ()) // TRUE
    [ ] Print (MainWin (&quot;$explorer6_DOM[3]&quot.Exists ()) // TRUE
    [ ] Print (MainWin (&quot;$explorer6_DOM[4]&quot.Exists ()) // FALSE</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I have a function that will kill all browsers using a similar technique. (I need to do this to make sure I've cleared non-persistent cookies.)

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[-] void KillAllBrowsers ()
    [ ] WINDOW wBrowser
    [ ]
    [ ] wBrowser = MainWin (&quot;$explorer6_DOM[1]&quot
    [ ]
    [-] while wBrowser.Exists ()
    [ ]
    [ ] wBrowser.SetActive ()
    [ ] wBrowser.Exit ()
    [ ]
    [ ] </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">You could probably do something along these lines for switching between the three browsers.

    - Dave
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  5. #5
    Member
    Join Date
    Feb 2003
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Differentiating Identical Browser Page by Index?

    Thank you very much!

    I've tried some scripts and it seems that we can identify the different browsers. I am just a bit confused on the dynamic index assignment for each browser window.

    When a browser window is set to active, it's assigned with index 1; the browser window that was active is dynamically assigned index 2, etc.

    It'll take me some time to figure out the ordering. Thanks for the help.

    David

  6. #6
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Differentiating Identical Browser Page by Index?

    Lemme harken back to my app development days, but I believe that this is called the zOrder, which is assigned by Windows. It's not who was launched first, second, etc. It's who's on top, closest to on top, next closest to on top, etc. Kinda like re-arranging a deck of cards and whichever card is on top is called the Ace Of Spades.

    One could probably kludge up a way of getting the process ID assigned to each window and determine which one is which that way. And that'd probably be a good choice for Window ID tags.

    I'll put this in as an enhancement request. Something they can get to right after making URL Window ID tags longer than 64 cahracters. [img]images/icons/rolleyes.gif[/img]

    - Dave
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

 

 

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 11.54%
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 10:38 AM.

Copyright BetaSoft Inc.