Read region value and return

Asked by muni on 2020-06-01

Hello,
Hope i can get an answer here.
I have a region where the count increases dynamically.
so i would like perform some actions based on the count,eg.if my region.value > 0 perform some print.However i see the below error.

[error] script [ testoutlook ] stopped with error in line 82
[error] AttributeError ( 'Region' object has no attribute 'count' )
[error] --- Traceback --- error source first
line: module ( function ) statement
65: main ( blotter ) if reg.count > 0:
70: main ( itrachistory ) blotter()
71: main ( itrac ) itrachistory()
81: main ( main ) itrac()
82: main ( <module> ) main()
[error] --- Traceback --- end --------------

Code is
def blotter():
                reg = Region(1590,950,320,59)
                count = 0

                wait(20)
                if reg.count > 0:
                    print("Blotter is loaded")
                else:
                    print("Blotter is not loaded")

            blotter()

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2020-06-01
Last reply:
2020-06-01
RaiMan (raimund-hocke) said : #1

.count() is not an implemented feature for class Region.

What do you want to achieve?

Does the mentioned reg contain some text/number, that should be read into a variable?

muni (rajeshmuni) said : #2

yeah mention region contain like integer count.When the Application loads initially the count would be displayed like count 0 out of 0>
when the application completely launched the count would go to 284 out of 284.
I dont need to wait till the count reaches 284,however i can exit from my code saying Application is running successful when the count >0

RaiMan (raimund-hocke) said : #3

try with reg.text()

make sure, the reg only contains the integer number.

muni (rajeshmuni) said : #4

Hi Raiman as i said the region contains Alpha numeric like below:

Count 0 outof 243

RaiMan (raimund-hocke) said : #5

as mentioned: try with documented features to read text from a region.

muni (rajeshmuni) said : #6

Hi Raiman may i know what do you mean by documented Features ??

Can you help with this problem?

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

To post a message you must log in.