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
Explain me what is a framework and what are the frameworks available in rc?
What kind of tests should not be automated?
Tell me what is the purpose of getoptions() method?
How does load testing work for websites?
What are the different types of scripting techniques for automation testing?
What is junit? And what is junit annotation?
What is the deference between automation tools and management tools?
Hi, I wanted to go with TestingDomain-Automation. Regarding this I need to take training on any one tool either WinRunner or LoadRunner. Which is better to get job,having future and takes lesstime with easier***. pls mention one tool name. Basically iam manual test engineer on unix- platform.
Explain what is the hybrid framework?
Tell me what are pros and cons of automating tests at ui layer?
What are the attributes of a good framework?
What is the different between GUI map and GUI map files?
Why automation testing?
How automation process is carried out?
Tell me what criteria do you consider for automating a test?