I’ve read through these topics for using data files and property lists:
http://www.testplant.com/phpBB2/viewtopic.php?t=147&highlight=text+file+data+property+list
http://www.testplant.com/phpBB2/viewtopic.php?t=641&highlight=text+file+data+property+list
… and I think I’ve almost figured out what I need to do, but am still missing a few pieces of the puzzle. I need a script that will read test data from a comma delimited file. I’d like the data file to contain a value indicating if the test is a negative test. As an example, let’s say my data file (with header) looks something like this:
TestId,NegativeOrPositive,LName,FInitial,Age
TC001,P,Smith,D,50
TC002,N,Jones,J,4.0
TC003,N,Williams,A,a
TC004,N,Garcia,B,0
Then I could use the following script to read the data:
put file "myTestDataFile.txt" into testData
put line 1 of testData into header
delete line 1 of testData
set the itemDelimiter to ","
repeat with data = each line of testData
set record to ( : )
repeat with n = 1 to the number of items in header
set property (item n of header) of record to item n of row
end repeat
insert record after recordList
End Repeat
Next is where I get lost. When I send the test data to the SUT, I will want to use the NegativeOrPositive value from testData record to determine if the result is a Pass or Fail. How do I use use the NegativeOrPositive value in each record of testData?
Any help is much appreciated!