Results 1 to 8 of 8

Thread: I have 2 browsers open having the same title and I want to close the second browser?

  1. #1
    Junior Member
    Join Date
    Apr 2007
    Answers
    10

    I have 2 browsers open having the same title and I want to close the second browser?

    I have 2 browsers open presently having the same title and I want to close the second or first browser using QTP Tool?

    Thanks in advance.


  2. #2
    Moderator
    Join Date
    Sep 2006
    Answers
    920

    Re: I have 2 browsers open having the same title and I want to close the second brows

    Why don't you select the option of"close the browser when test close".

    Or record the same action in QTP recording, QTP will do it for you.

    Regards,
    Brijesh Jain
    ---------------------------------------------------------
    Connect with me on Skype: jainbrijesh
    Google Plus : jainbrijeshji

  3. #3
    Expert Member
    Join Date
    Sep 2007
    Answers
    110

    Re: I have 2 browsers open having the same title and I want to close the second brows

    if Browser("index:=0").Exist(2) then
    a = Browser("index:=0").close 'It will close 2nd browser
    end if


  4. #4
    Expert Member
    Join Date
    Nov 2006
    Answers
    518

    Re: I have 2 browsers open having the same title and I want to close the second brows

    Rajaputra,

    I would like to kno how does this work... ?

    Lack of WILL POWER has caused more failure than
    lack of INTELLIGENCE or ABILITY.

    -sutnarcha-

  5. #5
    Expert Member
    Join Date
    Sep 2007
    Answers
    110

    Thumbs up Re: I have 2 browsers open having the same title and I want to close the second brows

    simple

    browser("index:=0").exist means to confirm that whether the particular browser is already opened or not. So that we can close.
    Here index =
    • 0 means recently opened browser
    • 1 means recent but one and so on



  6. #6
    Contributing Member
    Join Date
    Feb 2006
    Answers
    85

    Re: I have 2 browsers open having the same title and I want to close the second brows

    nice Solution,
    This is the only way to distinguish between two browsers which has the same name still sometime its really dificult to distinguish and it closes the wrong wondow .

    M still working on this to get a robust solution if anybody has ne suggestion then they can help me out.


  7. #7
    Expert Member
    Join Date
    Apr 2008
    Answers
    1,859

    Re: I have 2 browsers open having the same title and I want to close the second brows

    Hai friend,

    Just use this script

    If Browser("CreationTime:=1").Exist then
    Browser.close
    End If

    Thanks
    Deepa


  8. #8
    Junior Member
    Join Date
    May 2012
    Answers
    2

    Re: I have 2 browsers open having the same title and I want to close the second brows

    Try this:

    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = true
    IE.Navigate strAppUrl
    While IE.Busy
    Wend

    It worked for me


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact