how to close specific browser in QTP

1,412 views
Skip to first unread message

satya

unread,
Feb 23, 2010, 9:38:26 PM2/23/10
to QTP eLearn Team
When multiple browsers are opened, is there a way close a specific
browser. is there a better method then browser("xyz").CloseAll
method ? Becuse , it might close wrong browser sometimes.
How Can i use roproperty to close specific browser. ?

Karthik QTP

unread,
Feb 24, 2010, 2:01:53 AM2/24/10
to QTP eLearn Team, satya
You can use DP. If you know which browser to close, for ex: creation time, title, opentitle then it becomes easy to pinpoint to that particular browser.

set mybrow = description.create()
'mybrow("title").value = ".*xyz.*" ' contains a xyz in the title

mybrow("CreationTime").value = "0" ' Opens 1st opened browser
if browser(mybrow).GetROProperty("title") = "what you expect" then
   browser(mybrow).close
end if 

mybrow("CreationTime").value = "1" ' Opens 2nd opened browser
if browser(mybrow).GetROProperty("title") = "what you expect" then
   browser(mybrow).close
end if 
Depending on which title you want to close

Karthik QTP

unread,
Mar 1, 2010, 6:23:22 PM3/1/10
to satya ., QTP eLearn Team
Yes, if it is OR then DP. You cant use DP before and then OR. 
set mylink = description.create()
browser("patient search page"). page("patient search page").link("innertext := Logout", "name:= Logout").Click

OR 

set mylink = description.create()
mylink("innertext").value = "Logout"
mylink("name").value = "Logout"
browser("patient search page"). page("patient search page").link(mylink).Click
 
 


On Mon, Mar 1, 2010 at 1:36 PM, satya . <bsa...@hotmail.com> wrote:
Hi Karthik,
 
I want to make sure if we can use a combination of DP and object repository:
 
set mylink = description.create()
browser("patient search page"). page("patient search page"). mylink("innertext := Logout", "name:= Logout").Click
 
 
 
Thanks
Satya


Hotmail: Free, trusted and rich email service. Get it now.

satya .

unread,
Mar 1, 2010, 7:59:19 PM3/1/10
to kartik, qtp elearn
Hi,
 
I figured out how to do it.
 
Thanks anyway
satya
 
 
 
 

From: bsa...@hotmail.com
To: qtp.e...@gmail.com; qtp-ele...@googlegroups.com
Subject: How to move scripts from QC to QTP
Date: Mon, 1 Mar 2010 19:46:06 -0500

I have some old QTP scripts stored in QC. Can any one help me how to export them back to QTP ?
 
Thanks
Satya


Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up now.

satya .

unread,
Mar 1, 2010, 7:48:49 PM3/1/10
to kartik, qtp-ele...@googlegroups.com
Hi,
 
I have some old QTP scripts stored in QC. Can someone one help me how to export them back to QTP ?
 
Thanks
Satya

 


Hotmail: Trusted email with powerful SPAM protection. Sign up now.
Reply all
Reply to author
Forward
0 new messages