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

What are the differences between QTP 9.2 and 10? please explain e indetail......

2 Answers   Wipro,


How to recognize and read data from pdf file using Descriptive Programming in QTP?

1 Answers   Satyam,


How to automate a script in mainframes environment? I have the terminal emulator Add in. Describe in detail.

0 Answers  


Define object spy ?

0 Answers  


How we can do Batch testing in QTP?

6 Answers   Kanbay,


What is throw object?

1 Answers  


How to open any application during Scripting in QTP?

7 Answers   Celgene, IBM,


How can we redirect QTP results in to a excel sheet after the execution

3 Answers   SAP Labs, Virtusa,


What is business process testing(bpt) in qtp?

0 Answers  


What kinds of security (firewalls, encryptions, passwords, etc.) will be required and what is it expected to do? How can it be tested?

0 Answers  


Hi I have exp in manual testing and planning to move in automation testing qtp(9.2).So can help me how to automate customer relationship management tool using qtp and vb script this tool already developed so how can I test it whatever maintaining by development team like documents,various options just give the whole life cycle thanks in advance

0 Answers   Mphasis,


explian about the qtp frame work? where u can use it in your project?

1 Answers  


Categories