In an Excel sheet take two fields as agentname and password
and type some valid agentname and password.call that excel
sheet in qtp so that qtp opens the flightreservation window
taking into consideration how many records are entered in
the excel sheet.For example if 3 records are entered today
it will open 3 FR windows,if in near future the records are
more than 3 then it will open that number of times.

Answers were Sorted based on User's Feedback



In an Excel sheet take two fields as agentname and password and type some valid agentname and pass..

Answer / hari

var=datatable.getsheet(3).getrowcount

for i=1 to var
datatable.setcurrentrow(i)

Is This Answer Correct ?    3 Yes 0 No

In an Excel sheet take two fields as agentname and password and type some valid agentname and pass..

Answer / nagesh

let take a excel sheet with two feilds agentname and
password , in the first sheet of C:\testdata.xls , and
enter any number of users as you want , this simple example
will help you


DataTable.ImportSheet "C:\testdata.xls",1,1
rowcount=DataTable.GetSheet(1).GetRowCount

For i=1 to rowcount step 1
DataTable.GetSheet(1).SetCurrentRow(i)
SystemUtil.Run "C:\Program Files\HP\QuickTest
Professional\samples\flight\app\flight4a.exe"
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set DataTable.Value
("agentname",1)
Dialog("Login").WinEdit("Password:").SetSecure
DataTable.Value("password",1)
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Activate
Window("Flight Reservation").Close
Next

Is This Answer Correct ?    1 Yes 0 No

In an Excel sheet take two fields as agentname and password and type some valid agentname and pass..

Answer / ganesh

I am getting error for
Dialog("Login").Activate

Error: Login Object not found in Object Repository

Could you please tell me how to over come this.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

What is diff between SDLC AND STLC?

1 Answers   Nokia,


How u perform exception handling in QTp,what is other name for ths

1 Answers   Lehman Brothers,


Is there any thing that we can replace recovery scenario manager in QTP.

3 Answers  


It is regarding VBScript, how to export our function results to ExcelSheet through VBscripting. Ex: I have written add function, that result should export to Excel.

3 Answers  


I want two test two agents login for the flight website. Here is the scenario: I want to go through 1-3 rows for one user login and other user login I want to go though 3-5 rows. How would you set this up in qtp. Thank You

0 Answers   IBM,


How to export data present in Datatable to an ".xls" file?

2 Answers  


How to Close all browsers in reverse order.

3 Answers   Marlabs,


What are the advantages of qtp?

0 Answers  


What is Associate Repository in QTP 9.2 ?

0 Answers  


what is parameterisation?

3 Answers  


Why we have to import data from excel sheet to data table?becoz v can directly use test data directly from xl know. can u all pls explain me clearly

1 Answers  


what is Supplemental Objects ?

0 Answers  


Categories