Sign in to follow this  
Followers 0
sfresher

How to import data from a file? (txt, csv, or xls)

2 posts in this topic

I was trying to create a test application to auto GUI test, and I want to import all the test variables from a data file (txt, csv, or xls).

e.g. I want to test the "add" function of Windows Calculator. Instead of hardcode my script to test 1+5=6, 9+62=71, I can simple import data from a file, contains 1, 5,6, 9, 62, 71. By doing this, I can easily modify my test data in the feature.

Should I use any UDF to implement this?

Share this post


Link to post
Share on other sites



I was trying to create a test application to auto GUI test, and I want to import all the test variables from a data file (txt, csv, or xls).

e.g. I want to test the "add" function of Windows Calculator. Instead of hardcode my script to test 1+5=6, 9+62=71, I can simple import data from a file, contains 1, 5,6, 9, 62, 71. By doing this, I can easily modify my test data in the feature.

Should I use any UDF to implement this?

Yeah use a UDF. Use the forum search for finding a UDF to read csv/xls correctly. StringSplit would also help you ALOT...

[File.txt]

1,5,2,9,124,7,11,6,7

FileRead

StringSplit

From help file on StringSplit:

the first element ($array[0]) contains the number of strings returned

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0