How can I connect to flat file and access data using data driven testing

Showing Answers 1 - 2 of 2 Answers

sameera

  • Jun 14th, 2006
 

f="c:\sam.txt";

file_open(f,FO_MODE_READ/FO_MODE_WRITE/FO_MODE_APPEND);

#here we are reading values from notepad or flat file so mode should be #FO_MODE_READ

#FO_MODE_READ:operation which performs reading from flat file

#FO_MODE_WRITE:operation which performs writing from flat file

#FO_MODE_APPEND:operation which performs appends to existing file

while(file_getline(f,s)!=E_FILE_EOF)

#file_getline(filename,variable):this function is used to get line of value from notepad through a variable

#here is a we  used "s" variable for getting the test data from flat file

#perform any operation for eg: opening a record

#place that order number with variable

}

  Was this answer useful?  Yes

sameera

  • Jun 14th, 2006
 

f="c:\sam.txt";#path of file which we stored in variable f

file_open(f,FO_MODE_READ/FO_MODE_WRITE/FO_MODE_APPEND);

#opening the file in different modes

#here we are reading values from notepad or flat file so mode should be #FO_MODE_READ

#FO_MODE_READ:operation which performs reading from flat file

#FO_MODE_WRITE:operation which performs writing from flat file

#FO_MODE_APPEND:operation which performs appends to existing file

while(file_getline(f,s)!=E_FILE_EOF)

#file_getline(filename,variable):this function is used to get line of value from notepad through a variable

#here is a we  used "s" variable for getting the test data from flat file

#perform any operation for eg: opening a record

#place that order number with variable

}

file_close(f);#closing the file

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions