← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #243796]: Sikuli 1.0.1 - find() identifies wrong text

 

Question #243796 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/243796

Pathiyil posted a new comment:
Tried to see what OCR gives in this case, by 'iterating' over the rows
using Region.below(x).

cell_region = region.find("<Image of the column header>.png").below(20)

#Loop over the rows, read the text in the cell and print it out
for x in xrange(0, 25):
    print cell_region.text()
    cell_region = cell_region.below(20)
    click(cell_region)

The output is given below, which has a few interesting things:
  - For some reason, the beginning part of the string comes at the end (and seemingly with a new line prefixed to it)
  - Some existing spaces are getting stripped while some new spaces are getting inserted

The above 2 points might make even the comparison with Region.text()
work in an inconsistent fashion. Ofcourse, Region.text() can be replaced
with 'Copy and get the data from clipboard', but that might not work in
all cases (especially with Read-only UIs).

Output of the script snippet with the input data specified in the
original question:

4.15006/ 10/ 14 
XYZ

4.62509/08/14 
XYZ

5.37501/30/15 
XYZ

5.37501/30/15 
XYZ


5.12504/10/15 
XYZ


5.00009/15/15 
XYZ


3.37511/24/15 
XYZ


6.25001/15/16 
XYZ


5.75003/15/16 
XYZ


2.87503/ 16/ 16 
XYZ


4.75006/ 14/ 16 
XYZ


5.62502/27/17 
XYZ


5.62502/27/17 
XYZ


1.62503/20/17 
XYZ


6.50007/31/17 
XYZ


1.25009/26/17 
XYZ


5.37512/05/ 17 
XYZ


5.37512/05/ 17 
XYZ


1.50002/ 19/ 18 
XYZ


5.00006/04/18 
XYZ


4.62507/ 15/ 18 
XYZ


8.12511/26/18 
XYZ


8.12511/26/18 
XYZ


5.45006/ 10/ 19 
XYZ


4.37503/ 16/ 21 
XYZ

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.