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

Take a situation when you are working with QTP, suddenly system has crashed.so you again start the system. My questyion is how can QTP directly opened when the system desktop appears.

1 Answers  


write is the code for regular expression in QTP

2 Answers   IBM, Infosys,


What are the advantages of qtp?

0 Answers  


I am just a beginner in QTP. Could any one explain me in detail how to automate adding two numbers and getting the result in QTP. Also I would like to parameterize the inputs. I have tried but getting an error like 'Can't use sub.....'(can't recollect the exact error)

2 Answers  


Tell me about userdefined functions ?

1 Answers  






how to click the link in webpage by using QTP Script????????

3 Answers  


what is Entry Criteria and Exit Criteria?

2 Answers  


Inserting a Call to Action is not Importing all columns in Datatable of globalsheet. Why?

3 Answers  


I want to do QTP Certification what is the pattern of Question paper.

0 Answers  


What is the logic for reading(exporting)the data from flat files to QTP?Can anyone explain me with an example? I appreciate it!!! Thanks!!! Prasanna

1 Answers  


how we connect oracle or sql data server database to qtp

3 Answers   Tanla Solutions,


What is the exact difference bet function and action in QTP Anybody can explain it in detail..Thanks in advance..

12 Answers   Wipro,


Categories