X-1.0rc3: IDE: "with Region" doesn't work after first run - uses whole screen --- workaround
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Fix Released
|
Critical
|
RaiMan |
Bug Description
--- workaround
put the code block (no indentation !) between
setROI(some_region)
#...
# code
#...
setROI(SCREEN)
-------
# According to http://
# "All methods inside the with block that have the region omitted are redirected to the region object specified at the with statement."
# Based on this statement, I would expect the following code to only highlight the bottom three icons.
# Tested on both 64 bit Windows 7 and OSX Lion with identical results.
# Version: Sikuli X 1.0rc2 "Maltese" Released on 2011/02/10
# Expected results:
# * The script should highlight the test image, the bottom half of the test image, and the bottom three icons in the test image.
# Actual results:
# * All 6 icons are highlighted.
# Steps to reproduce:
# 1. Close all running copies of the Sikuli IDE.
# 2. Open TestImage.png in an image viewer at 1:1 zoom level. (Possibly by viewing the .html file)
# 3. Open the Sikuli IDE and load this script.
# 4. Run the script. During the first run you will see the expected behavior. It will only highlight the bottom three icons.
# 5. Run the script again. This time and any time after, it will highlight all 6 icons. This is not the expected behavior.
testimage = find()
testimage.
bottomhalf = Region(testimage)
bottomhalf.
bottomhalf.
bottomhalf.
with bottomhalf:
icons = findAll()
for icon in sorted_icons:
summary: |
- "with Region" doesn't work after first run in IDE + X-1.0rc3: IDE: "with Region" doesn't work after first run - uses whole + screen |
Changed in sikuli: | |
status: | New → Confirmed |
description: | updated |
summary: |
X-1.0rc3: IDE: "with Region" doesn't work after first run - uses whole - screen + screen --- workaround |
description: | updated |
Changed in sikuli: | |
status: | Confirmed → Fix Committed |
assignee: | nobody → RaiMan (raimund-hocke) |
milestone: | none → x1.0 |
tags: | added: idererun |
Changed in sikuli: | |
importance: | Undecided → High |
Changed in sikuli: | |
importance: | High → Critical |
Changed in sikuli: | |
status: | Fix Committed → Fix Released |
@Keith
- a general solution, to get the content region of an app window (this is for Mac ;-)
- the app must be running in this case
ap = App("Preview") 1).below( top).below( win.h-top) highlight( 2)
top = 55
ap.focus()
win = ap.window()
content = win.above(
content.
so no need to capture/find the whole content.