region text not working properly or may be some bug

Asked by BIPIN

hello guys,
let me show first code then issue.

s = Screen();
r = Region();
num = 2.00;
s.wait(num);
p = s.find("RecordLbl.png");
bounds = s.getBounds();
ocr_x = 0; ocr_y = 0; ocr_w = 0; ocr_h = 0;
ocr_x = p.x + p.w + 350;
ocr_y = p.y + 0;
ocr_w = bounds.width - ocr_x -20;
ocr_h = p.h + 0;
rect = Rectange(
counter = 1
for x in range(0, 3):
    while True:
        for z in range(0, 10):
            reg_text = r.create(ocr_x,ocr_y,ocr_w,ocr_h);
            text1 = reg_text.text();
            print(" printing text " +text1);
            if text1 == "":
                break;
    counter +=1;
    if counter >5:
        break;

In my scenario there is a loader icon that moves horizontally in a defined region, to detect loader we use region.text() function. it returns some values when there is the loader or else it returns the empty string "".
In this region.text() function, we use the loop to detect loader, as soon as it finds loader it returns a value, but the problem occurs when the loading screen disappears but still region.text() function returns a value instead of an empty string, it looks like bot can still see loader in the region.
it looks like there is a problem with the region or text function cache.
moreover ,if there is no loader in the region, region.text() function return empty string "" .

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.