Getting values from excel to testplant


I have some complex calculation in my test cases like quartile ,Sales Forecast and average sales calculations etc etc

Our Manual team created one formula driven excel with all the calculations. Only thing we need to capture the values from web page and put in the appropriate cells in the excel. That help us to get the formulated value from excel to compare with web page value.

Since test plant not support excel directly we need some alternate solution to do this. Could you please guide me to get some solution on this?


You have several options here. The choice depends on how much data you are talking about and how frequently you change the data.
[]You can open the Excel file on the SUT using Excel. Then you can automate it like you would any other application. Probably extracting values using the remoteClipboard() function. This is best if you are only reading a small number (dozen or so) data values.
]You can save the Excel file as a .CSV file. SenseTalk has good support for reading CSV files. This will be better with lots of data, but adds a step to the file editing process.
[*]You can also setup your Excel spreadsheet to function as an ODBC data source and with version 14 you can use the Database capabilities to read from the table. This would take the most setup but if you are updating your spreadsheet all the time then it might save you time in the long run.

Related to this topic I do have some further questions:
Is it possible to copy the values from a .csv file into a matrix form in eggplant? or we are only able to copy a line into a list etc. using ‘put each line of file “.csv” into list’?

I am asking this, because I am having problems in working properly with an imported .csv file, namely iterating through the matrix (array nxm) or determining the index of an element in the matrix.

Thank you in advance for your answer!

The Eggplant users need much more examples in general, there is a lack in your eggplant documentation regarding this!!!

You will want to break up the CSV using chunk expressions as described here:

So basically,

repeat with each line myLine of myFile
	repeat with each word  myWord delimited by "," of myLine
		put myWord
	end repeat
end repeat

In the loop above you can also do things like:

put item 5 of myLine

Or, if you want to parse the entire csv file into a matrix (a list of lists in SenseTalk), you could do something like this:

set source to {{
a,  b,c,d,e
1,2 , 3 ,4,5
v, w,x ,y, z


put each word delimited by " ," of each line of source into matrix
put matrix -- ((a,b,c,d,e),(1,2,3,4,5),(v,w,x,y,z))
put item 4 of item 3 of matrix -- y

Two things to note from this example:

  1. Each expressions can be chained to make a list of lists. This can be very powerful, but may require some experimenting to get exactly the result you’re after.
  2. Word delimiters can include multiple characters (space and comma in this case) which will treat any contiguous group of those characters as a single delimiter. This can be handy, as in this case for stripping out varied spaces around items.