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 is test driven development?
What are the different types of scripting techniques for automation testing?
Can we do automation testing without a framework? If yes, then why do we need a framework?
Hi All! Am new to Selenium and would really appreciate your help writing test cases for the following scenario: 1. Manually create 2 logins User A and User B on say, orkut.com or facebook.com. 2. Have User A invite User B as a friend. 3. Have User B accept the friend request. 4. Have User A post a comment on his own profile. 5. Have User B post a reply to that comment. 6. Each User logs out of his respective account. 7. Do not use Selenium IDE. 8. Use Selenium RC and Java.
Where will you maintain information like url, login, password?
Do you know what is functional testing?
What is the purpose of getoptions() method?
Tell us what is the difference between getwindowhandles() and getwindowhandle()?
What are the things that one should consider for selecting a project for test automation? For example, stability, etc.
What is the difference between continue and next sentence?
Simplify the term defect severity.
What are the pre-requisites to start automation testing?
What steps are needed in developing and running a software test?
What kind of tests should not be automated?
What java api is required for generating pdf reports?