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. |
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...
|
|||||||
|
|||
|
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. |
| Sponsored Links |
|
|||
|
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- |
|
|||
|
Quote:
better to select datadriver option. i think u understand. by chalapathi. Last edited by jainbrijesh; 09-18-2007 at 06:16 AM. |
|
|||
|
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 |
|
|||
|
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- |
|
|||
|
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 |
|
|||
|
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.
|
|
|||
|
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* |
|
|||
|
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 |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
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 |