ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Testing  >>  Automation Testing  >>  QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions
 Load Runner interview questions  Load Runner Interview Questions
 QTP interview questions  QTP Interview Questions
 Test Director interview questions  Test Director Interview Questions
 Rational TestSuite interview questions  Rational TestSuite Interview Questions
 Silk Test interview questions  Silk Test Interview Questions
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions
Question
Hi 
I have a doubt in qtp. Can you please clarify my doubt.

If we are importing the data from excel sheet in qtp the 
the script is running the number of row times.

I mean if there are 4 rows in excel sheet the script is 
running 4 times. cant we avoid this.

suppose i have tis script:

datatable.Import  "C:\Documents and Settings\sailaja\My 
Documents\login1.xls"
n = datatable.GetRowCount
For i =1 to n
systemutil.Run "C:\Program Files\Mercury 
Interactive\QuickTest 
Professional\samples\flight\app\flight4a.exe"
datatable.SetCurrentRow i
Dialog("Login").WinEdit("Agent Name:").Set DataTable
("Username", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").Set DataTable
("Password", dtGlobalSheet)
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").ActiveX
("MaskEdBox").Type "020209"
Window("Flight Reservation").WinComboBox("Fly 
From:").Select "Frankfurt"
Window("Flight Reservation").WinComboBox("Fly 
To:").Select "Los Angeles"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights 
Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "Sailaja"
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").WinMenu
("Menu").Select "File;New Order"
window("Flight Reservation").Close
next
I created a excel sheet with 3 rows and 2 columns. 
(username and password).  The script is running 9 times. I 
made the option run one itaration only . eventhough it is 
running 9 times .can u plaese clarify my doubt.



Thankyou
Sailaja.
 Question Submitted By :: Sailaja
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Hi I have a doubt in qtp. Can you please clarify my doubt. If we are importing the data from excel sheet in qtp the the script is running the number of row times. I mean if there are 4 rows in excel sheet the script is running 4 times. cant we avoid this. suppose i have tis script: datatable.Import "C:\Documents and Settings\sailaja\My Documents\login1.xls" n = datatable.GetRowCount For i =1 to n systemutil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe" datatable.SetCurrentRow i Dialog("Login").WinEdit("Agent Name:").Set DataTable ("Username", dtGlobalSheet) Dialog("Login").WinEdit("Password:").Set DataTable ("Password", dtGlobalSheet) Dialog("Login").WinButton("OK").Click Window("Flight Reservation").ActiveX ("MaskEdBox").Type "020209" Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt" Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles" Window("Flight Reservation").WinButton("FLIGHT").Click Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click Window("Flight Reservation").WinEdit("Name:").Set "Sailaja" Window("Flight Reservation").WinButton("Insert Order").Click Window("Flight Reservation").WinMenu ("Menu").Select "File;New Order" window("Flight Reservation").Close next I created a excel sheet with 3 rows and 2 columns. (username and password). The script is running 9 times. I made the option run one itaration only . eventhough it is running 9 times .can u plaese clarify my doubt. Thankyou Sailaja.
Answer
# 1
Hi Sailaja, 

As by defalut in Test menu-->Settings-->Run Tab

Options will be -- Run on all rows 
Hence if datatable contains 'n' number of rows, script will 
execute that much number of times.

To avoid the above situation:

1.Go to Test menu-->Settings-->Run Tab
2.select "Run only one iteration" option button
3.Click Apply -> OK

4.In script give the below code 
  
  datatable.import "excel file path"
  rowcount=datatable.getrowcount
  for i=1 to rowcount
   datatable.setcurrentrow(i)
    -------

    -----
  Next 

Now see ur prolem will be solved.


Cheers, 
Sreekanth
 
Is This Answer Correct ?    0 Yes 0 No
Sreekanth Chilam
 
  Re: Hi I have a doubt in qtp. Can you please clarify my doubt. If we are importing the data from excel sheet in qtp the the script is running the number of row times. I mean if there are 4 rows in excel sheet the script is running 4 times. cant we avoid this. suppose i have tis script: datatable.Import "C:\Documents and Settings\sailaja\My Documents\login1.xls" n = datatable.GetRowCount For i =1 to n systemutil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe" datatable.SetCurrentRow i Dialog("Login").WinEdit("Agent Name:").Set DataTable ("Username", dtGlobalSheet) Dialog("Login").WinEdit("Password:").Set DataTable ("Password", dtGlobalSheet) Dialog("Login").WinButton("OK").Click Window("Flight Reservation").ActiveX ("MaskEdBox").Type "020209" Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt" Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles" Window("Flight Reservation").WinButton("FLIGHT").Click Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click Window("Flight Reservation").WinEdit("Name:").Set "Sailaja" Window("Flight Reservation").WinButton("Insert Order").Click Window("Flight Reservation").WinMenu ("Menu").Select "File;New Order" window("Flight Reservation").Close next I created a excel sheet with 3 rows and 2 columns. (username and password). The script is running 9 times. I made the option run one itaration only . eventhough it is running 9 times .can u plaese clarify my doubt. Thankyou Sailaja.
Answer
# 2
Hi Srikanth
Thankyou soo much. Now my script is running fine . Before I 
did the same setting in keyword view->Action right click 
Action call properties Run on all rows.But it did not 
solved my problem . Once again thankyou soo much.

Regards 
Sailaja.
 
Is This Answer Correct ?    0 Yes 0 No
Sailaja
 
 
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
how can i do QTP Certification can any 1 tell me . How 1 approch and who to approch Hydus6
how to load the *.vbs (or) test generating script in a new machine? Ordain-Solutions3
What is the function of Filter in QC . give with a real time example. TCS1
what is frame work?  2
How would you parameterize the text field "Country" and the same "country" when it appears as combo field on other page with text field city and same with City combo field? Adobe1
is it possible to check the text displayed in the tool tip using QTP? if so, how?  3
what is framework in QTP? any one give me answer Wipro3
i need to learn the descriptive programming very well so for that what to do am reading the qtp user mannual but it is not so any materials or links with examples i want please help me  1
what is option explicit?  5
Without QTP (or any Testing tool) can we able to test the GUI part of the Applications. for Example generating the Scripts in Notepad and Executing them Using VB. Is it Possible to do so.. Correct me if iam wrong some where. Microsoft8
Hi all , I am new at QTP I want a sample script to check validation messages(For java script or VB script) for login page with for web based application.. Any one can Help. I have to complete it in two days I need urgent help.. Ex. if I want to check mail.yahoo.com 1 > If user doed not exist it display "Username does not exist" 2> if invalid Uname and password then it display" Invalid Uname or pass" 3> Loing Sucssessfully. I want to check this types of application by using data table to give values of username and password.. Thanks  2
examples of user definied functions? how to write user defined functions in qtp9.2? IBM2
How to find the number the number of Links, Brolken Links in a webpage? Ordain-Solutions3
I AM NEW IN QTP,PLZ TELL ME ANY BOOKS FOR QTP, MY COMPANY IS QTP,SO I LEARN QTP,PLZ ANYBUDY HELP ME AZTEC53
How many types of Parameters are available in QTP? and Pls Explain with example. LG-Soft3
What are the challenges do we face while testing webbased applcations using the automation tool QTP or any?  1
how to write this script using descriptive programming? the script below is the script generated by QTP plz write the script using descriptive programming? plzzzzzzzz do answer thanku Browser("Welcome: Mercury Tours").Page("orkut - login").WebEdit("Email").Set "test123" Browser("Welcome: Mercury Tours").Page("orkut - login").WebEdit ("Passwd").SetSecure "475259b450e3d212bef4a5f5ce9d32ebcbf4" Browser("Welcome: Mercury Tours").Page("orkut - login").WebButton("Sign in").Click Browser("Welcome: Mercury Tours").Page("orkut - home").Link ("Logout").Click Browser("Welcome: Mercury Tours").Page("orkut - login").Sync Browser("Welcome: Mercury Tours").Close  1
What is the latest version of QTP? aster googling i found it 9.5 . but somewhere in my frnds resume i hve seen 10.0 so i am a bit confused pls let me know. NCR3
What is User defined function in QTP Bank-Of-America4
What is descriptive.create () in QTP?  2
 
For more QTP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com