← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #185414]: observe inactive tab

 

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

Description changed to:
I\m using Opera web browser. It is not using windows like IE, it uses
tabs.

When I use focus on app.window() it seems to treat only the window and
not the tab. So I need to have the right tab in focus, for it to observe
anything.

it recognizes/finds the tab title, so why would it not focus on the
right tab?

my question is, how do I get it to observe one tab, when I'm working in
another tab?

code snippet:

    myApp = App("title here")
    myRegion = myApp.window()
    if not myRegion:
        popup("didnt find it")
        break
    myApp.focus() <---------- doesn't do anything, not bringing it to front, besides I want the tab to come to front not the window
    while not exists("X.png"):  <-------- does not fire unless its showing on screen
        wait(30)     
    myRegion.highlight(2)  <------------------ highlights the main window, not the tab
    click("X.png") <--------------- fails the second time read below

I have problem with not being able to stop the script. alt+c or
alt+shift+c do not work.

but also there is a problem second time it is executing the loop, it
tries to click twice and fails. thus I get back the IDE:

lets say the window IS current
it then detects the X
highligts window and clicks X and that window goes away
then it sleeps till next time
it finds X
it highlights and clicks X
window dissapears
then it highlights and tries to click... then it fails.. 

fyi: X is closing a window inside a game in the browser. its not a real
windows window.

[error] Error message: Traceback (most recent call last):
 File "C:\DOCUME~1\KALLEK~1\LOKALA~1\Temp\sikuli-tmp5486196643606122912.py", line 11, in 
 click("X.png")
 Line 1, in file C:\DOCUME~1\KALLEK~1\LOKALA~1\Temp\sikuli-tmp5486196643606122912.py

 at org.sikuli.script.Region.handleFindFailed(Region.java:420) 
at org.sikuli.script.Region.wait(Region.java:511) 
at org.python.proxies.sikuli.Region$Region$0.super__wait(Unknown Source) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 

org.sikuli.script.FindFailed: FindFailed: can not find X.png on the screen.
 Line 1, in file C:\DOCUME~1\KALLEK~1\LOKALA~1\Temp\sikuli-tmp5486196643606122912.py

writing only my first lines of code I don't know, is it my code or
sikuli that is buggy? :D

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