How to work with multiple browsers when opened in the window,
write the script for it

Answers were Sorted based on User's Feedback



How to work with multiple browsers when opened in the window, write the script for it..

Answer / nilanjan saha

Hi all,

We can handle the Multiple Browsers with the Creation Time
property of the Browser.

For the Browser we have Creation Time ordinal identifier.
First browser that opened after opening QTP by default gets
Creation Time:=0, next populates with 1,2 and so on...

We can also manipulate this value from Test Object property
window.

e.g:

Let 3 separate browsers are open. To work on the 2nd one we
can come up with following code:

Browser("CreationTime:=1").page("micclass:=page").Image("micclas:=Image","alt:=Continue
to Login").Click
wait(2)
Browser("CreationTime:=1").close

Please let me know if you found anything I missed.

Regards,
Nilanjan

Is This Answer Correct ?    1 Yes 1 No

How to work with multiple browsers when opened in the window, write the script for it..

Answer / nitin sharma

For working on multiple browser you have to use creationtime
or index property.
Use this code
'opening two application gmail and yahoo
Systemutil.Run"iexplore.exe"
Systemutil.Run"iexplore.exe"
Wait(10)

Browser("micclass:=Browser","creationtime:=0").Navigate"http://www.gmail.com"
Browser("micclass:=Browser","creationtime:=1").Page("micclass:=Page").Navigate"http://www.Yahoo.com"

'for closing all browser
While Browser("title:=.*","index:=0").Exist
Browser("title:=.*","index:=0").Close
Wend

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More QTP Interview Questions

Explain how qtp identifies object?

0 Answers  


How would you export a script from one pc to another in qtp?

0 Answers  


how do you configure QTP AND Test director?

1 Answers   Satyam, TCS, VB,


I am getting the "test object property" Description properties "toolkit class" value By using "gettoproperty" in run time But my problem is how to get Ordinal Identyfier's type and value Type is index, value is 0 How can i keep this values in to required place How can i get these values in runtime I have to insert these "index" and "value" into another area Is there any script for this like "gettoproperties","Getroproperties" If anybody knows,please help me .

0 Answers   Livetek,


What are the features of quick test pro(qtp)?

0 Answers  






How would you parameterize the text field "Country" and the same "country" when it appears as combo field on other page with text field city and same with City combo field?

1 Answers   Adobe, Patni,


Hi Friends, Would be great if you can provide the Model Question paper, Web site link or any reference s. Thanks & Regards, Byzoor,

0 Answers  


give one example where you have used regular expression?

6 Answers   Ordain Solutions,


What kind of performance is expected on the client side (e.g., how fast should pages appear, how fast should animations, applets, etc. load and run)?

0 Answers  


Please Clarify if smartidentfication is used at runtime when qtp does not recogonize the objects

3 Answers   Ordain Solutions,


What are SetToProperty, SetRoProperty, GetToProperty scripting?

2 Answers  


What is the difference between Global and Local Data Sheets?

1 Answers  


Categories