If there are some browsers opened and I don't how many browsers are open, Now I want to close all the browsers that I don't know how many are opened.
What would be Descriptive programming for this in QTP using VB Script..???
Please send your answers.

Answers were Sorted based on User's Feedback



If there are some browsers opened and I don't how many browsers are open, Now I want to close a..

Answer / m.ganesh

Set odesc=description.Create
odesc("micclass").value="Browser"
Set a=Desktop.ChildObjects(odesc)
print a.count
For i = 0 To a.count-1
browsername= a(i).getroproperty("name")
print browsername
Next

Is This Answer Correct ?    10 Yes 1 No

If there are some browsers opened and I don't how many browsers are open, Now I want to close a..

Answer / mogal

Set odesc=description.Create
odesc("micclass").value="Browser"
Set BrowCol=Desktop.ChildObjects(odesc)
For i = 0 To BrowCol.Count-1
BrowCol(i).Close
Next

Is This Answer Correct ?    3 Yes 0 No

If there are some browsers opened and I don't how many browsers are open, Now I want to close a..

Answer / dinesh1433

systemutil.CloseProcessbyName("iexplore.exe"

Is This Answer Correct ?    1 Yes 0 No

If there are some browsers opened and I don't how many browsers are open, Now I want to close a..

Answer / rangalnrt

set Objects = description.create
Objects("micclass").value = "Browser"

set Childs = Desktop.childobjects(Objects)

for i=0 to Childs.count-1 step 1

Browser("index:="&i).close

next

if Browser("index:=0").exist then

msgbox "Fail"

Else

msgbox "Pass"

End if

Is This Answer Correct ?    1 Yes 0 No

If there are some browsers opened and I don't how many browsers are open, Now I want to close a..

Answer / mogal

While Browser("creationtime:=0").Exist(0)

Browser("creationtime:=0").Close

Wend

Is This Answer Correct ?    1 Yes 0 No

If there are some browsers opened and I don't how many browsers are open, Now I want to close a..

Answer / kaps

'Check if this is working
Dim TrueOrFalse

Do while("True")
  TrueOrFalse = Browser("index:=0").Exist(2)
  if(TrueOrFalse = "False") then  
   exit do
  else
   Browser("index:=0").close    
  end if
Loop

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More QTP Interview Questions

I have 3 browsers i want to give facebook url in 2 nd browser using qtp

3 Answers   Tech Mahindra,


What is the difference between browser sync and page sync in QTP?

2 Answers  


Could you please any one give code for the following ? Scenario : Suppose a excel file contains 10 records and earch have 5 fields. how can i input this excel file for datadrive wizard ? Please explain

0 Answers  


i want 8.2 and 9.2 dacuments plhelp any body sand it to my id sandhyat1@yahoo.co.in

3 Answers   Siloka,


how to validate email?email ie correct or not ?with below conditions. 1)before @(symbol) only alphbates and min 4 char to max 15 chars. 2)before @(symbol) only alphabates dont use ant special chars or numarics 3) after @(symbol) only one dot(.)symbol for ex:abc@gmail.com it is valid email or not based above conditons

2 Answers   Aspire,






Explain how qtp identifies object?

0 Answers  


How to retrive the property of an object?

5 Answers  


Is there any relation between Keyword Driven Framework and Recording modes provided in QTP( whether Recording modes are applied on keyword driven framework or not?)

0 Answers   IBM,


Give the syntax to load function at run time.

0 Answers  


Which functionalities of QTP used in banking project?

0 Answers  


can u explain about QTP Frameworks? what are the framework types are available? and How to set or create frame work for a application? Explain briefly?(Also give me one example)

1 Answers  


How function returns a value?

1 Answers  


Categories