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                      
tip   To Refer this Site to Your Friends   Click Here
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 to handle exception when data table is not available in local host system or path is not correct(explain statement with example)  1
can some one help me how to compare the values from one sheet to values in another sheet? suposse i have a feild called Temp in action1 and i also have temp in action2. i want to compare the values of those two actions sheets data table? how can i do it using descriptive programming?  1
How we can add objects to the object repository during the running?is it possible or not?explain  3
What are the difference between QTP and Winrunner  5
What is the file extension of the code file & object repository file in QTP?  2
How can we get a textcheckpoint in QTP9.1? EmTechPro2
In QTP if u got a defect , how to report to developer using Test director or Quality center . Wipro3
Recovery Manager means..?  4
What is Active Screen in QTP?  8
how to test power point using QTP 8.2 ? WHAT ARE DIFFERENT METHODS TO RETRIEVE VALUE FROM APPLICATION DURING RUNTIME ? HCL2
How the automated tests in org Maintec1
What is diff betwee datatable.importsheet "path" and datatable.import  1
DIFFERENCE BETWEEN WR 8.2 & QTP 8.2? HOW TO INTEGRATE WITH SOME OTHER TOOLS? CTS1
How do u connect database through QTP tell me both Ms Access and SQL Livetek2
Can u call txt extension file in QTP? Cap-Gemini2
How can we open an Excel sheet through the script eSymbiosis6
Idid my qtp course in 2007 june in mind Q i for got to use this tool ,i want to mention in my resume about this ,how can i rectify this ,pls give me any idea . Quest2
what is bultin funtaion in QTP &tell me five examples? Kanbay3
How we can call the scripit from another scripit in QTP?,Not a call Action  6
is it possible to map an image as standard Object or u've to treat as virtual? how to map an Dynamic image into standard object?  1
 
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