assigning variable from Excel

Asked by Richard Matthews

Hi,
I am using Sikuli to automate the creating of accounts for testing a banking application.
I have an excel file with random customer data in it. I would to read the data in a single
random line into variables in Sikuli i.e Name, Address, Phone etc.what is the easiest way
to do this? if I open the excel file, how do i assign the values in a cell to a variable in Sikuli ?

Cheers Richard

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Richard Matthews
Solved:
Last query:
Last reply:
Revision history for this message
Richard Matthews (richard-matthews) said :
#1

Found some info on web, ended up like this:
type("c",KEY_CTRL)
FirstName =Env.getClipboard()
type(Key.RIGHT)
type("c",KEY_CTRL)
Surname = Env.getClipboard()
type(Key.RIGHT)
type("c",KEY_CTRL)
ShortEntityName = Env.getClipboard()
type(Key.RIGHT)
type("c",KEY_CTRL)

Revision history for this message
surfdork (surfdork) said :
#2

You could save the Excel data as a .csv then use the CSV module in Python

http://effbot.org/librarybook/csv.htm

http://docs.python.org/library/csv.html

you can assign the variables within def's (function's) or globally

I'm working on a similar issue.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Then you might both be interested in the Python/Jython package xlrd, which allows to directly read and write XLS files. (http://pypi.python.org/pypi/xlrd/0.7.1)

If tested it together with Sikuli and it works fine.