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
What type of scenarios can't be automated?
Is automation testing in agile methodology useful or not?
hi i would like to know is there any training institue for Calabash,robotium and ui automator in hyderabad...urgent
HOW CAN WINRUNNER AND TEST DIRECTOR CONNECTED TO THE DATABASE AND WHAT R THE OPTIONS?
Explain me what is the difference between setspeed() and sleep() methods?
If i am doing the automation of test suites in a project. Then what will be the system interfaces for that?? The tools I am using or something else... please help..!!
What are the most popular tools for automation testing?
can any one please tell me QTP 9.2 supports which version of IE and Mozilla firefox.
What is junit? And what is junit annotation?
Explain about basics of rational robot - ibm test automation tool?
Can you achieve 100% automation?
Anyone have idea of jmeter.IF so pls contact to this mail id arun130887@hotmail.com
Tell us how could you explain the main difference between webdriver and rc?
Tell us how do you get the width of the textbox?
What is meant by the automation framework?