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

I need to pull the data from the page which in row, column vice into excel sheet, how can it be done using QTP? eg: Name Dept xyz gdty i need the same data to be exported in excel sheet.

1862


What r the different filters in defect in quality center

3450


To which environments does quicktest professional supports?

690


How to add synchronisation points in qtp?

713


If you have two monitors one is of 19inch and the 2nd one is of 24inch,if you want to write same QTP script in both the two monitors is there any changes required in the script?

1713






How are actions and functions different in QTP?

785


Hi! Using Descriptive Programming How do we get Parent object for an object by writing script(DP). Say, i want to get a parent object for a "Link" in a web page by writing script in Descriptive Programming.

2262


Explain how Does Run time data (Parameterization) is handled in QTP?

702


Hello, Is there any way to send the test results in html format (or any other) by email using outlook after the test run ends? thank you in advance

1925


i am a begnner so am learning Error handling :tried using Recovery manager didnt work i want to be able to handle errors , e.g. if while running the test the folwoing does not show up then how can i use the If then else and goto next step in the test, as in many scenarios it does not show up Browser("The Shopping Channel -").Page("The Shopping Channel -_8").Image("easy pay").Click

1666


Could anyone help me for the below scenario: i am using the descriptive programming for my account, in which we have to generate the contract in the MS-word. when i generate this doc, we need to click on enable macros to continue further. but i am unable to make qtp to click on this. if anybody faced the problem like this??? pls help to get it resolved? Thanks in advance

1574


what type of automation is follwed in the project?

1645


I am a newbie to QTP / Automation testing. I want to develop a script that creates a data file automatically with proper headings using VBScript in QTP.

1736


what is the difference betn QTP 8.0 AND PREVIOUS VERSION

2108


How many types of recording modes in qtp?

744