how to read data from a csv file using Test complete
functional tool..please can anyone post the code

Answer Posted / sheeja paul

var RecNo;
// Creates the driver (main routine)
function TestCSVDriver()
{
var Driver;

Driver = DDT["CSVDriver"]("C:\\MyCSVFile.csv");

// Iterates through records
RecNo = 0;
Driver["DriveMethod"]("csvread.ProcessCSVData");

// Closing the driver
DDT["CloseDriver"](Driver["Name"]);

}

function ProcessCSVData()
{
var i;
for(i = 0; i < DDT["CurrentDriver"]["ColumnCount"]; i++)
{
Log.Message(DDT["CurrentDriver"]["ColumnName"](i));
Log.Message(DDT["CurrentDriver"]["Value"](i));
}
RecNo = RecNo + 1;
}

// Content of MyCSVFile.csv is
//Head 1,Head 2,Head 3,Head 4,Head 5
//Z1,Z2,Z3,Z4,Z5
//Y1,Y2,Y3,Y4,Y5

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me how could ajax controls be handled in webdriver?

534


Tell us what is the difference between getwindowhandles() and getwindowhandle()?

505


What is difference between selenium and QTP tools Which is best tool... Which is most used tool

937


Tell me the fundamental difference between xpath and css selector?

567


What are the references for TSL functions.? Could anybody suggest me recommended book for Test Script Language.

1692






how to write ciertification in QTP?

1629


how to know whether the user information or any other information which is entered in to the web is storing in secured place or non secured place?

1574


Give some examples for test management tools?

585


When will you not automate testing?

603


What is tsl?

571


pls tell me any open source test case managment tool ? its urgent.also tell me any autmation testing tool also for functional testing?

1695


I want to test a mobile software by an automation tool which is a IP telephony based software designed for both ios and android phone, basically this apps is develop for make call though few low cost audio codecs from Aircraft to Ground and Ground to Aircraft so anyone can suggest me which testing tool we can use for it

2161


What are the advantages of test automation?

580


Name a couple of standard web function found in the function generator?

547


How to select an automation tool best matched for your project?

512