Get region for chrome on windows

Asked by ABET

Has anyone successfully created a script to capture the region for browsers that do not have a title bar (like Chrome) in windows?

This does not seem to work:
a = App("Chrome")
a.focus()
r = Region(a.window()
print r

I also tried to use a.window(1); with other indexes as well. but it just could not find and set the region for Chrome in windows.

Using XP , Vista and 7

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
RaiMan (raimund-hocke) said :
#1

chrome version?

Revision history for this message
ABET (abetv) said :
#2

chrome v19.0.1084.56

same issue with safari v5.1.7. Where the app name 'safari' is not in the title.

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

tested on Win7, same Chrome version:

works perfectly for me, either with "Chrome" or "Google Chrome"

a = App("Chrome")
for i in range(100):
    w = a.window(i)
    if not w: break
    print i, " # ", w
wait(2)
a.focus
wait(2)

- all windows are printed
- the frontmost window gets focused

the wait()'s help to see the actions.

Revision history for this message
Johno Crawford (johno-crawford) said :
#4

Another thing to keep in mind is to make sure you are not running another instance of Chrome or alternatively, run your test Chrome instance with the --no-first-run --user-data-dir flags.

Can you help with this problem?

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

To post a message you must log in.