How to get variable text from application screen and store that value in Excel in Rows

Asked by kiran maroju

Hi,

We use invoice generation application, in which it generates different invoice number for each invoice.

So i want to get that value into Excel sheet.

And also i want to compare that invoice number from that with number in screen in another application screen.

How can i do that?
Please help me

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
obiwan-92 (obiwan-92) said :
#1

Hello,

First select the text you want capture with your mouse (by a double click, for example), then :
type('c', KeyModifier.CTRL) # type a classic CTRL + C
text = Env.getClipboard() # get the value saved in the clipboard
# give the focus where you want to write the text
paste(text)

Hope it's help.
Regards.

Revision history for this message
Eugene S (shragovich) said :
#2

Hi,

Are you asking how to copy a number or how to insert it into an Excel document?
Also, about the other number you want to compare to.. Where it is located?

Revision history for this message
kiran maroju (kiranmaroj) said :
#3

Eugene,
 i want to Insert the number from screen into Excel, automatically for each transaction made by Sikuli tool.

Afterthat i want to compare those numbers from Excel with the numbers displayed in in other screen.

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

For the convenient handling of Excel sheets in SikuliX (Jython) have a look at modules xlrd, xlwt, ... faq 2208

Since then the numbers come as text from the Excel sheet, you have to again capture the number from the screen as text (either as comment #1 suggests or using Sikuli's OCR feature Region.text())

Revision history for this message
Eugene S (shragovich) said :
#5

So what exactly are you asking about:

1. How to copy value using Sikuli
2. How to write to excel file using Python?
2. How to compare value with another value stored in Excel?

Can you help with this problem?

Provide an answer of your own, or ask kiran maroju for more information if necessary.

To post a message you must log in.