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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How you are developing the script? Using record and play back or manual?

682


hi, can u tell me the QTP TEsting process in present real time companies?(beware of this... now a days Recording is not using,, only DP) and don't tell note book answers like step 1 spep2....like this .......post answer with professional skills in simple english words) thank u

1399


Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.

2987


can any body clearly explain about keyword driven framework .give me the explanation for files what ever you use in this frame work?

1756


I have some real time based question.. 1.what are the challenges you have faced in your current project. 2.what are the bugs you found in your current project. 3.what are the strategies you follow to convert manual test cases into automation test cases. 4.how QTP identify two different browsers. 5. When you create a function library and share object repository what are the problems you have faced 6. How to solve the tool tip problem 7.what are the interesting bug you have found in your current project. 8.what is your daily work as a automation test engg. 9. how to create a weekly status report. 10. how many test cases you write,review and execute per day. 11.what are the uses of SQL in automation. 12.How to retrieve the data in html through vb script. 13.If application is very slow how to test the application in qtp.

3646






How do we handle run-time errors?

651


how to prepared for first for the first interview?

1871


please give me the code for doing retesting of gmail login page using functions so the function has to give the value

1615


Can any one tell me how to write a script for selecting open option in File menu of A word document.here you have to add objects to OR.try like that and give me the ans.i asked this question to so many but no one knows.if any one know the answer plz let me know

1460


Explain QTP using different development techniques ?

601


What is the syntax to call one action in another?

614


If we put all properties in mandatory and assistive list of Normal Identification, Do we still need Smart?

639


How can you identify the browser and its information using QTP script?

617


I want to know what are QTP functons and what are VB script functions. What is the difference between them.When we have to use these functions.

1351


is it possible to add sheets to excel at runtime

3355