Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

How to pass parameters from excel sheet into an application form through qtp(code)

This is a discussion on How to pass parameters from excel sheet into an application form through qtp(code) within the QTP forums, part of the Software Testing category; HI 2 all How to pass parameters from excel sheet into an application form through qtp. i need code to perform this task.so plz help me...... bye...

Go Back   Geeks Talk > Software Testing > QTP
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 05-30-2007
Junior Member
 
Join Date: May 2007
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
chundikirankumar is on a distinguished road
HI 2 all

How to pass parameters from excel sheet into an application form through qtp. i need code to perform this task.so plz help me......

bye

Last edited by jainbrijesh; 09-18-2007 at 06:15 AM.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-31-2007
Expert Member
 
Join Date: Nov 2006
Location: Hyd-IND
Posts: 528
Thanks: 1
Thanked 63 Times in 50 Posts
sutnarcha is on a distinguished road
Re: How to pass parameters from excel sheet into an application form through qtp(code

I think you are talking about data driven testing
__________________
Lack of WILL POWER has caused more failure than
lack of INTELLIGENCE or ABILITY.

-sutnarcha-
Reply With Quote
  #3 (permalink)  
Old 05-31-2007
Junior Member
 
Join Date: May 2007
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
chundikirankumar is on a distinguished road
Re: How to pass parameters from excel sheet into an application form through qtp(code

hi thanx for replying yes data driven testing..iam new to qtp.if uknow plz help me out if possible.


thanx

bye
Reply With Quote
  #4 (permalink)  
Old 06-13-2007
Junior Member
 
Join Date: Feb 2007
Location: bangalore
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
sirigiri.vcr is on a distinguished road
Quote:
Originally Posted by chundikirankumar View Post
HI 2 all

How to pass parameters from excel sheet into an application form through qtp. i need code to perform this task.so plz help me......




bye
Hi kiran,
better to select datadriver option.
i think u understand.
by
chalapathi.

Last edited by jainbrijesh; 09-18-2007 at 06:16 AM.
Reply With Quote
  #5 (permalink)  
Old 06-15-2007
Contributing Member
 
Join Date: Feb 2006
Posts: 37
Thanks: 3
Thanked 7 Times in 6 Posts
dsharma is on a distinguished road
Re: How to pass parameters from excel sheet into an application form through qtp(code

You need to create objects in Excel to do that as follows -

set sh = CreateObject("Scripting.FileSystemObject")
set exl = CreateObject("Excel.Application")
exl.visible = true

excel_path = Datatable.Value("p_path_mainxls")

set wb = exl.WorkBooks.Open(excel_path)

'Open the intended worksheet
set ws_content = wb.Worksheets("Sheet1")

ws_content.Activate

list_value = exl.ActiveSheet.Cells(5,4).Value

'Then you can use this list_value to pass onto the application like,
Browser().Page().WebEdit().Set list_value
Reply With Quote
  #6 (permalink)  
Old 06-15-2007
Expert Member
 
Join Date: Nov 2006
Location: Hyd-IND
Posts: 528
Thanks: 1
Thanked 63 Times in 50 Posts
sutnarcha is on a distinguished road
Re: How to pass parameters from excel sheet into an application form through qtp(code

dsharma's examples are correct

If the data is to be taken from QTP's Data Table, then the following statement should help you...

Window("XYZ ABC").Dialog("OPEN").WinEdit("Edit").Set DataTable("A", dtGlobalSheet)
__________________
Lack of WILL POWER has caused more failure than
lack of INTELLIGENCE or ABILITY.

-sutnarcha-
Reply With Quote
  #7 (permalink)  
Old 07-05-2007
Contributing Member
 
Join Date: Mar 2007
Location: Florida,United States
Posts: 35
Thanks: 0
Thanked 2 Times in 2 Posts
myth.ks is on a distinguished road
Re: How to pass parameters from excel sheet into an application form through qtp(code

hi below is the code, if ur external datatable contian more than one iteration....

DataTable.Importsheet "Path of the excel.Xls","Sourcesheet",Designationsheet",

iRowCnt = DataTable.GetSheet.GetRowCount

For iNumber=1 to iRowCnt

DataTable.SetCurrentRow(iNumber)
v_iretriveValFrmDataTable = DataTable("ColumnName","")

Next
Reply With Quote
  #8 (permalink)  
Old 07-09-2007
Contributing Member
 
Join Date: Feb 2006
Posts: 85
Thanks: 0
Thanked 3 Times in 3 Posts
kunals is on a distinguished road
Re: How to pass parameters from excel sheet into an application form through qtp(code

Also there is one easy way is follow what the process mentioned in the QTP help book. thats the easiest way to start working on the Data Driven Testing.
Reply With Quote
  #9 (permalink)  
Old 07-11-2007
Contributing Member
 
Join Date: Feb 2006
Location: Beverly, Boston
Posts: 43
Thanks: 1
Thanked 1 Time in 1 Post
smartarun is on a distinguished road
Re: How to pass parameters from excel sheet into an application form through qtp(code

Whatever dsharma has written the code is correct and it works properly.

Arun*
Reply With Quote
  #10 (permalink)  
Old 07-16-2007
Junior Member
 
Join Date: Jul 2007
Location: hyderabad
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
gopathipraveen is on a distinguished road
Re: How to pass parameters from excel sheet into an application form through qtp(code

hi

plz try this once

DataTable.AddSheet"login"
DataTable.ImportSheet"C:\Documents and Settings\Administrator\Desktop\Book1.xls","input","login"
rc=DataTable.GetSheet("login”).Getrowcount
For i=1 to rc
DataTable.SetCurrentRow(i)
systemutil.Run"C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set DataTable("UserId",3)
Dialog("Login").WinEdit("Password:").SetSecure DataTable("Password",3)
Dialog("Login").WinButton("OK").Click
If (Window("Flight Reservation").Exist) then
reporter.ReportEvent 0,"Given Test is ","pass"
DataTable.Value("Result",3)="pass"
else
reporter.ReportEvent 1,"Given Test is ","fail"
DataTable.Value("Result",3)="fail"
end if
Window("Flight Reservation").Close
DataTable.SetNextRow
next
DataTable.ExportSheet"c:\Documents and Settings\Administrator\Desktop\Book1.xls",3



Regards
gopathi
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
reading data from excel sheet in QTP JobHelper QTP 12 3 Weeks Ago 09:46 AM
I have given 5 test cases in excel sheet Geek_Guest Test Director 3 02-13-2008 06:55 AM
Test cases in excel sheet chsrikanth Testing Issues 2 04-14-2007 03:36 AM
100 test cases from TD into an excel sheet Lokesh M Test Director 2 12-23-2006 04:20 AM
Code for getting data from excel sheet JobHelper WinRunner 0 12-20-2006 07:08 PM


All times are GMT -4. The time now is 03:40 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved