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

is it possible to change the date format like MM/DD/YY into DD/MM?YY through script in QTP

5 Answers   IBM,


Hi Guys, here I am posting one question. Wen u r working with Notepad. If it is not responding in the middle of TEst...what u will do.

7 Answers  


What is regular expression?

0 Answers  


How many types of Parameters are available in QTP?

1 Answers  


Does QTP supports Linux or Unix OS?.If so which scripting is preferable? Shell we do record and playback

1 Answers  






WHY U CHOOSE TESTING FIELD?

6 Answers   CybAge, TCS,


how we connect oracle or sql data server database to qtp. Hi Ram I was your answer for this. Can you kindly let me know in details steps on How we can connect to database. i am using QTP9.2 and SQL Server Database. I am new for QTP and this would be of great help.Thanks

2 Answers  


How we can merge the object repositories?say if we have 2 or 3 object repositories then how we can merge them?Is there any option in QTP to merge the object repositories?

2 Answers  


what is the difference between data driver & data driven and driver script?

0 Answers  


if there r 10 windows open in QTP write a command to close all 10 windows at a time ?

10 Answers   Wipro,


Hi, Am trying to download QTP 8.2 version.its not supporting Windows Vista.Can you please help me out from this.Which QTP version supports this. Thanks in Advance.

2 Answers  


what is runmodes in QTP

1 Answers  


Categories