GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Testing Tools  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 657 of 677    Print  
parametrization using file
How do we input values from file


  
Total Answers and Comments: 2 Last Update: July 10, 2008     Asked by: monika agrawal 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: akothuru
 
Generally, QTP exports uses Excel file for data paramaterization.
1)Prepare test data in Excel sheet and import into QTP data table. Using DataTable methods, user can easily parameterize data and access them through out the script.
DaTaTable Methods: Import, ImportSheet, Export, ExportSheet, GetSheet, SetCurrentRow, SetNextRow etc...

E.g:
DataTable.Import "Excel file path"
testData = DataTable(columnName, Sheetname)
(or)
testData = DataTable(columnName, dtGlobalSheet)


2)Prepare test data in Excel sheet. Instead of importing Excel file/sheet into Test script, create an Excel object in the script using CreateObject method. Using Excel object methods user can able access data from excel sheet.

E.g:
Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.WorkBooks.Open "Excel file path", false, false
Set currentWorkSheet = ExcelObj.ActiveWorkBook.WorkSheets(1) 'first sheet
testData = currentWorkSheet.Cells(rownumber,columnnumber).Value
ExcelObj.Application.Quit

Above answer was rated as good by the following members:
ashwini248, knr321
July 10, 2008 02:00:53   #1  
akothuru Member Since: April 2008   Contribution: 37    

RE: parametrization using file
Generally, QTP exports uses Excel file for data paramaterization.
1)Prepare test data in Excel sheet and import into QTP data table. Using DataTable methods, user can easily parameterize data and access them through out the script.
DaTaTable Methods:
Import
ImportSheet
Export
ExportSheet
GetSheet
SetCurrentRow
SetNextRow etc...

E.g:
DataTable.Import "Excel file path"
testData = DataTable(columnName, Sheetname)
(or)
testData = DataTable(columnName, dtGlobalSheet)



2)Prepare test data in Excel sheet. Instead of importing Excel file/sheet into Test script, create an Excel object in the script using CreateObject method. Using Excel object methods user can able access data from excel sheet.

E.g:
Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.WorkBooks.Open "Excel file path", false, false
Set currentWorkSheet = ExcelObj.ActiveWorkBook.WorkSheets(1) 'first sheet
testData = currentWorkSheet.Cells(rownumber,columnnumber).Value
ExcelObj.Application.Quit

 
Is this answer useful? Yes | No
July 10, 2008 02:06:26   #2  
akothuru Member Since: April 2008   Contribution: 37    

RE: parametrization using file
Generally, QTP exports uses Excel file for data paramaterization.
1)Prepare test data in Excel sheet and import into QTP data table. Using DataTable methods, user can easily parameterize data and access them through out the script.
DaTaTable Methods: Import, ImportSheet, Export, ExportSheet, GetSheet, SetCurrentRow, SetNextRow etc...

E.g:
DataTable.Import "Excel file path"
testData = DataTable(columnName, Sheetname)
(or)
testData = DataTable(columnName, dtGlobalSheet)


2)Prepare test data in Excel sheet. Instead of importing Excel file/sheet into Test script, create an Excel object in the script using CreateObject method. Using Excel object methods user can able access data from excel sheet.

E.g:
Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.WorkBooks.Open "Excel file path", false, false
Set currentWorkSheet = ExcelObj.ActiveWorkBook.WorkSheets(1) 'first sheet
testData = currentWorkSheet.Cells(rownumber,columnnumber).Value
ExcelObj.Application.Quit

 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    

 Related Questions

Latest Answer : The File extension of the script file is ".vbs"object repository files are two types : 1. Per Action Repository - ".mtr"2. Shared Repository - ".tsr" ...

Explain the process of creating a test for an xml file which is uplaoaded in the application where it is validated?
Read Answers (2) | Asked by : chaw

How to add my own function in QTP.when I run my function in QTP then its throw an error "Error in library file. Your function library may not be valid.Do you want to continue running the test?"Now how to add library file & which file. DO u have any example of function how to write in QTP
Read Answers (3) | Asked by : rajivkumarnandvani

How to load a .tsr file(object repository) in QTP thru code as it is in the Winrunner like, gui_load. Is there any script exist in QTP8.2
Read Answers (10) | Asked by : batcha

Where is the bitmap checkpoint information saved? a) In Temporary folder b) In resource.mtr under action folder c) In the Script.mts folder under the action folder d) In the checkpoint.usr file

I am trying to use a template file (containing reference to settings file, comments etc..,). I have created 'ActionTemplate.mst' in the \'dat' folder .But when I open a new test file the template is not created.Please help.Thanks!
Read Answers (6) | Asked by : SG

1. When will writing automation scripts starts, Is it beforecoding Phase? or After Coding Phase?2.Without seeing the UI screens how will write automation scripts,Isit possible to write test scripts without GUI Map file(WR) or Objecttest repository(QTP

How to automate editing an XML file .because when i record the editing on an XML file and run it,some other field gets edited while running the script and not the one i tried to edit.please help.
View Question | Asked by : charm

How can we validate the PDF file recognization and its content with the help of Mercury product QTP(Quick Test Professional)?
View Question | Asked by : ravi

Latest Answer : kindly refer vb script help which comes as a prt of qtp help ...


 Sponsored Links

 
Related Articles

SQA Software and Tools

SQA Software and Tools In quality assurance it is always important to get all the help we could get In other industries developers could easily check the products manually and discard those that do not meet the standard The length and the width of the product are checked to maintain standardization
 

Business Network Virtual Communication Tools

Business Network Virtual Communication Tools Since ages the Business community heavily relied on face to face communication for building Business relationships Face to face communications formed the basis for trust in a relationship An individual’ s appearance or the physical appearance of
 

What are Data Access Tools

Data access is the process of entering a database to store or retrieve data. Data Access Tools are end user oriented tools that allow users to build structured query language (SQL) queries by pointing and clicking on the list of table and fields in the data warehouse. Thorough computing history, t
 

What is Data File

In a logical data model, the conceptual data model which is based on the business semantic is being defined. Thus, entities and relationships and corresponding table and column design, object oriented classes, and XML tags, among other things are being laid regardless of the database will be physica
 

Testing and Integration

Once the software is complete, it will go though rigorous testing before its actual integration.  In this article we will take a look at different types of software testing and also different types of integration. With the diversity of business setting and software development models, it al
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

SAP and Microsoft tools for Customer Service

World’s largest car dealer to use SAP and Microsoft tools for Customer Service Inchcape, the London-based largest car dealer in the world, is making itself much strong now by improving its customer services arising from major SAP and Microsoft implementations. The company has also vowed to
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

Career Assessment Tools

For those not sure what type of career they are interested in pursuing, career assessment tools can provide help. There are assessments available at career centers that are designed to help people figure out a good career option. They explore your personality, skills, interests, and values, and can
 

Advantages of Using SAP R/3 in comparison with other Similar Tools

ERP system takes a lead role because of some of the following reasons: Many large corporations use several different and separate information systems, often because they have merged with and/or acquired other companies with varied systems. An ERP system integrates these separate information systems
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape