ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Testing  >>  Automation Testing  >>  QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions
 Load Runner interview questions  Load Runner Interview Questions
 QTP interview questions  QTP Interview Questions
 Test Director interview questions  Test Director Interview Questions
 Rational TestSuite interview questions  Rational TestSuite Interview Questions
 Silk Test interview questions  Silk Test Interview Questions
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions
Question
Suppose there are 10 browsers opened on desktop. I want to 
close all browsers except one browser in QTP. Can any one 
give the code for this?
 Question Submitted By :: Gvnsuresh
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Suppose there are 10 browsers opened on desktop. I want to close all browsers except one browser in QTP. Can any one give the code for this?
Answer
# 1
you can use descriptives programming concepts.
"CreationTime" is a QTP browser property, which indicates 
the order in which browsers were opened.
To close 1st browser --> Browser("CreationTime:=0").Close
2nd browser --> Browser("CreationTime:=1").Close.
you can use a loop to close other 9 browsers..
 
Is This Answer Correct ?    6 Yes 0 No
Sharath
 
  Re: Suppose there are 10 browsers opened on desktop. I want to close all browsers except one browser in QTP. Can any one give the code for this?
Answer
# 2
Assuming all 10 browsers are IE6

Set browserDesc = Description.Create() 
browserDesc(”application version”).Value = “internet 
explorer 6″ 

Set Allbrowsers = DeskTop.ChildObjects(browserDesc) 
BrowserCnt = Allbrowsers.Count 

  For i = 0 To (browserCnt -2) 
  Allbrowsers(i).Close
  Next 

Set browserColl = Nothing 
Set browserDesc = Nothing
 
Is This Answer Correct ?    1 Yes 1 No
Rico
 
 
 
  Re: Suppose there are 10 browsers opened on desktop. I want to close all browsers except one browser in QTP. Can any one give the code for this?
Answer
# 3
just made a small correction. Here goes the updated answer



Set browserDesc = Description.Create() 
browserDesc(”application version”).Value = “internet 
explorer 6" 

Set Allbrowsers = DeskTop.ChildObjects(browserDesc) 
BrowserCnt = Allbrowsers.Count 

  For i = 0 To (browserCnt -2) 
     Allbrowsers(i).Close
  Next 

Set browserColl = Nothing 
Set browserDesc = Nothing
 
Is This Answer Correct ?    4 Yes 0 No
Rico
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
Tel me what was the automation testing process you followed?  2
How can you capture(Read) the values from a Table?  1
what do u mean by test harnesses in qtp? Verizon1
How to handle the exceptions using recovery secnario manager in Qtp?  2
How to face prjoect manager round what type of questions they will Ask ? (Chandana) IBM1
What is the Maximum syncronization timeout in seconds in QTP 9.5 Polaris4
How to Synchronize the Browser at Field level? For example if you put Browser.sync(), its waiting upto for that Browser sync only. It should wait total Browser get upload with fields. IBM3
w is fragmentation and paging MBT1
Where are the snapshots stored?  2
What is the difference between Call to Action and Copy Action.?  2
what is the use of descripting programming? Ordain-Solutions4
How to open any application during Scripting in QTP? IBM6
Suppose Object name was changed in the application in the second build.I have just modified the name in the Object repository as changes in the Application. Is it possible to accure changes in the script accordingly? If so Suppose I am calling the script through function, Will the changes affect in the script(which is in the function)automatically? If not affected, tell me the solution,How to handle this. How should I change the object property name while using functions Livetek4
How you automate test scripts Novartis1
In a webtable, lets say there are 10 records and 1 column. let say "image" is available for 1st,2nd and 3rd records and 4th onwards image is not available. How to recognise for that cell image is available or not?  2
what is purpose of automation?  2
how to merge 2 object repositories in qtp 9.0.what is use of merge and y merge is used?  1
if the excel sheet specified in script is not there,we get run time error how to handle the error ,please anybody explain me in detail Quinnox1
in qtp how we work with out put values and what is the process?  4
What are the recording modes and executing modes avialble in QTP? Polaris3
 
For more QTP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com