Geeks Talk

Prepare for your Next Interview




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

This is a discussion on I have 2 browsers open having the same title and I want to close the second browser? within the QTP forums, part of the Software Testing category; 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....


Go Back   Geeks Talk > Software Testing > QTP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-16-2007
Junior Member
 
Join Date: Apr 2007
Location: India
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
rkiran416 is on a distinguished road
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.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-28-2007
Moderator
 
Join Date: Sep 2006
Location: Delhi (India)
Posts: 866
Thanks: 12
Thanked 81 Times in 65 Posts
jainbrijesh is on a distinguished road
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.
__________________
Brijesh Jain
brijesh.tester@yahoo.co.in
http://softwaretestingexpertise.blogspot.com
Reply With Quote
  #3 (permalink)  
Old 10-08-2007
Contributing Member
 
Join Date: Sep 2007
Location: Hyderabad
Posts: 93
Thanks: 1
Thanked 14 Times in 13 Posts
rajaputra is on a distinguished road
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
Reply With Quote
  #4 (permalink)  
Old 10-08-2007
Expert Member
 
Join Date: Nov 2006
Location: Hyd-IND
Posts: 523
Thanks: 1
Thanked 55 Times in 46 Posts
sutnarcha is on a distinguished road
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-
Reply With Quote
  #5 (permalink)  
Old 10-08-2007
Contributing Member
 
Join Date: Sep 2007
Location: Hyderabad
Posts: 93
Thanks: 1
Thanked 14 Times in 13 Posts
rajaputra is on a distinguished road
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
Reply With Quote
  #6 (permalink)  
Old 10-09-2007
Contributing Member
 
Join Date: Feb 2006
Posts: 73
Thanks: 0
Thanked 3 Times in 3 Posts
kunals is on a distinguished road
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.
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Web Browsers norman Windows 2 10-14-2008 12:33 PM
Retrieveing the title of the currently active window Geek_Guest QTP 6 06-28-2008 02:21 AM
Why we have to close connection, statement, prepared statement Geek_Guest Java 8 02-27-2008 07:09 AM
customizing title bar... psuresh1982 Web Design 1 07-20-2007 06:39 AM
This program uses the artist name and title of the composition from ID3 tag for compa JobHelper Geeks Lounge 0 06-27-2007 10:40 AM


All times are GMT -4. The time now is 12:46 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved