how do you done Data-driven test using MS-Word Instead of
DataTable

Answer Posted / rajani

using the following script we do the data driven test, data
from flat file i.e., from notepad, Ms-Word etc.,
option explicit
dim fso,f,n
set fso=createobject("Scripting.filesystemobject")
set f=fso.opentextfile("path of word doc.",1,false)
while(f.atendofline<>true)'read the file to the end of file
n=f.readline()'line by line reading

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to convert 100 into hundred repees only and viceversa

1682


can any body plz help by sending the qtp docs and qtp ppt's? this is my mail id:murali.padeti@gmail.com

1976


What is the extension of qtp local repository?

768


What are the different properties of an web object

1630


Output values? i want a practical example

1516


Thanks....But can u tell me how i use the QTP for GIS with one Example...

1659


I have two For loop, first For loop does is creates a customer and input the customer info and then the second for loop within the first for loop does the follows which is capture the customer name and verify the with the data within the datatable. The problem I am coming across is that when it goes through the second time creating another customer and then verify the second customer then it creates the following during runtime. I want is to have the customer2 below Customer1 under the Customer_from_Apps. Any help will be greatly appreciate it. Customer Customer_from_Apps Customer_from_Apps1 Customer1 Customer 1 Customer2 Customer2 Window("Customer Desktop").Window("Customer Tracking (Privacy").WinObject("TreeView20WndClass").Click 92,244 runtimevalue = .VbTreeView("vbname:=AppServerTree").GetROProperty("Selectio n") Customer_Val= Datatable.GlobalSheet.AddParameter ("Customer_from_Apps",runtimevalue) row=datatable.getsheet("Global").GetRowCount For x=1 to row datatable.SetCurrentRow(x) Data_Val=Datatable.Value("Customer",dtGlobalSheet) If (trim(Customer_Val)=trim(Data_Val)) Then Reporter.ReportEvent micPass, "Customer validation successful", "Actual Value: " &Data_Val&vbcrlf& "Customer Value: " &Customer_Val else Reporter.ReportEvent micFail, "Cusotmer validation unsuccessful", "Actual Value: " &Data_Val&vbcrlf& "Customer Value: " &Customer_Val End If Next

1574


How to customize qtp?

795


Could any one tell me "How can i recognize my cursor position using QTP 9.2" Give me a scripts for this

2260


How can you exit from an action?

797


Explain how you can find length of array in qtp?

810


How to analyzing test results using quicktest professional?

886


How to create scenario selector

1701


ACTUALLY I AM WORKING IN THE DISTRIBUTION DOMAIN.MY COMPANY IS PROVIDING DISTRIBUTION SOFTWARE FOR PHARMA AND FMCG DISTRIBUTORS.HERE I AM USING QTP 9.2.HERE IN MY APPLICATION WHILE RECORDING ONE WINDOW APPEARS.IN THAT I CAN SELECT THE ITEM OR NO NEED TO SELECT.BUT WHILE RUNNING THE SAME SCRIPT THE WINDOW MAY NOT APPEAR OR APPEAR.HOW TO WRITE SCRIPT FOR THIS

1726


How to interact tool & application build in QTP?

1666