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
How do you choose which automation tool is best for your specific scenario?
Give some examples for test management tools?
Can you explain data-driven testing?
what is GDC
What is the major difference between Functional test, Acceptance test, Usability test and performance test. With special reference to automotive domain
Any kind of test which you think should not be automated?
List down the primary features of a good automation tool?
Do you know what is a xpath?
How do i startup with Remedy testing tool. Couldnot able to find any links for startup. Please help me to startup with this remedy tool.
What are the advantages of automation testing?
What is junit? And what is junit annotation?
Tell me what is tsl? What 4gl is it similar too?
How you report bug in to bugzilla
Tell me what is regression testing?
Is automation testing in agile methodology useful or not?