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   SiteMap shows list of All Categories in this site.
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
How can we parameterize our test, values in flat file.
Ex:- Values in notepad, with that values i want to 
parameterize the test.
 Question Submitted By :: Srikanth
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How can we parameterize our test, values in flat file. Ex:- Values in notepad, with that values i want to parameterize the test.
Answer
# 1
'Open a notepad and enter some values in 
'line by line and save it (C:/a.txt)
'FlightReservation window should be opened

set obj=createobject("scripting.filesystemObject")
set file=obj.opentextfile("C:/a.txt")
i=1
While file.atendofline<>true
n=file.readline
datatable.setcurrentrow(i)
datatable(1,1)=n
i=i+1

'Record some transactions by opening a ordermenu and
'enter order number

Window("Flight Reservation").WinMenu
("Menu").Select "File;Open Order..."
Window("Flight Reservation").Dialog("Open 
Order").WinCheckBox("Order No.").Set "ON"

'replace order number which u entered
'at the recording with n

Window("Flight Reservation").Dialog("Open Order").WinEdit
("Edit").Set n
Window("Flight Reservation").Dialog("Open Order").WinButton
("OK").Click
if(Window("Flight Reservation").Dialog("Open Order").Dialog
("Flight Reservations").exist)then
		Reporter.ReportEvent 
micFail, "OrderNo "&n, "Not Exist"
		Window("Flight Reservation").Dialog("Open 
Order").Dialog("Flight Reservations").WinButton("OK").Click
Window("Flight Reservation").Dialog("Open Order").WinButton
("Cancel").Click
datatable(2,1)="not Exist"
else
			Reporter.ReportEvent 
micPass, "OrderNo "&n, "Exist"
			datatable(2,1)="Exist"
	end if
Wend


Try for this u will get it.
 
Is This Answer Correct ?    0 Yes 0 No
Arunsingh
 
  Re: How can we parameterize our test, values in flat file. Ex:- Values in notepad, with that values i want to parameterize the test.
Answer
# 2
Hi Dear friends!
As per my knowledge iam giving the script to do datadriven
by flatfile in qtp.
 First creat a notepad with some inputs in d system
thenOption explicit
Dim fso,f,x
set fso=createobject ("scripting.filesystemobject")
set  f=fso.opentextfile("Path of the notepad")
While f.atendofline <>true
	x=f.readline
	
Window("Flight Reservation").WinMenu("Menu").Select
"File;Open Order..."
Window("Flight Reservation").Dialog("Open
Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open
Order").WinEdit("Edit").Set x
Window("Flight Reservation").Dialog("Open
Order").WinButton("OK").Click
Window("Flight Reservation").WinButton("Delete Order").Check
CheckPoint("Delete Order")
Wend
 
Is This Answer Correct ?    0 Yes 0 No
Ratankumar
 
 
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
hai, i am doing QTP by own. So, i am confident in checkpts,synchronization, data driven test, recovery scenarioe manager etc. but actually i don't know how all these we wil implement while we r writting code manually. when we r doing practice, while recording code is automatically generated but in real time i heard that we have to write the script.But i don't know how it is? How to write descriptive prog.? plz. tel me what r the basic things we have to know? explain how to write descriptive prog.? explain me with an example pls....... Vertex2
While testing .net applications with QTP 9.1 in normal recording mode, QTP records my unintentional mouse clicks and window dragging which I don't want. But I can't stop QTP recording those mouse clicks and window dragging. Can somebody let me know how I can get rid of it, please ! Thanks.  1
what is Unicoad Compatibility ???? HOw does this makes a diffrence from Winrunner.??? GE1
In QTP, while launching qtp application from startup.. we find Advanced Keyword-Driven Testing caption.. wht is that...Anybody can pls explain it. Thanks in Advance US-Technology1
what is compiled module?  1
what is the abbrivation of .mtr in action reposirtory? GE5
What will be the script for recovery scenerio.plzanyone give ans with aexample related to banking project Yahoo2
How to change the scripts from Per-Action object repository to shared object repository  1
How Does Run time data (Parameterization) is handled in QTP? IBM2
How we can merge the object repositories?say if we have 2 or 3 object repositories then how we can merge them?Is there any option in QTP to merge the object repositories?  2
How do we edit the script in QTP. Anybody can explain in detail..Thanks in advacne... IBM2
How do you learn the object in QTP?  1
diff between dim & redim ? in detailed? pls any one explain me?  1
how can you describe the basic flow of automation with conditional and programmatic logic? Ordain-Solutions1
i need the word "good morning" to be displayed by default whenver we click upon the blank test while opening the qtp. Could you please answer...  7
What is the difference between Dim And Redim IBM2
How can we fill data in a text box without recording using object spy. Can you please provide the steps... TCS1
what is defination of regression testing?  2
can u write one user defined function for webedit class. Cap-Gemini4
Where the text version of script file located in file system?  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