Jump to content

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


sfresher
 Share

Recommended Posts

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?

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...