Mac: Cannot focus Firefox 8.0.1

Asked by Sleek

Hi,

I have been using Sikuli X 1.0rc3 for a few weeks now and it has been working fine with Firefox 8, however since updating to Firefox 8.0.1 the following code no longer works, any ideas why this would be happening or a workaround?

// Open and set focus to Firefox (on Mac).
a = App('Firefox');
a.focus();

Note that this still works with "Google Chrome", "Safari".

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Sleek
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Just updated FF 5 to FF 8.0.1 on my Mac Lion (installed in /Applications).

App class works perfectly as expected.

What are the symptoms? What is the message area telling?

Revision history for this message
Sleek (sleekism) said :
#2

Hmm this is very strange. It could be something to do with my Firefox.. I'll try it on another Mac and post an update here. Here is a test code i just run using the Sikuli-IDE:
bogus = App('ABCD');
bogus.focus()
print bogus.window()

firefox = App('Firefox');
firefox.focus()
print firefox.window()

safari = App('Safari');
safari.focus()
print safari.window()

And the log:
[log] App.focus ABCD(0) #0
[log] openApp: "ABCD"
[error] App.focus failed: ABCD not found
None
[log] App.focus Firefox(0) #0
[log] openApp: "Firefox"
None
[log] App.focus Safari(0) #0
[log] openApp: "Safari"

Region[46,22 1837x1127]@Screen(0)[0,0 1920x1200] E:Y, T:3.0 E:Y, T:3.0
------

As you can see when the app is not found I do get an error, but Firefox does not have an error. I tried "Firefox.app" as well but still no go. Firefox it self runs fine so :/ I'll investigate further..

Thanks for your help RaiMan

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

Yes, must have something to do with you Firefox installation.

In a few cases even on a Mac a system cold start helps ;-)

Revision history for this message
Sleek (sleekism) said :
#4

Update:
There seems to be an issue on my Mac. I noticed that if I use just "Firefox" then I can see something popup in the dock for like 100ms and disappear. The only way I can run Firefox is by using full path (App('/Applications/Firefox.app')). Oh and yes I did restart :)

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

Check what happens, if you say from a Terminal session:

open -a "Firefox"

Revision history for this message
Sleek (sleekism) said :
#6

I get no errors and I can see that its trying to start for like 100ms (Terminal window lose focus) but then nothing happens. open -a "Safari" works fine.

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

I guess, there is an additional older FF version on your system somewhere or at least some zombie (folder Downloads ?) or it is a problem with an extension (try to deactivate them first).
or back to the roots: Try to delete everything, that is related to Firefox or org.mozilla.firefox (~/Library, ~/Library/Application Support, ~/Library/Preferences, /Applications). Finally empty trash and restart.
... and install totally from scratch (might be painful, if you have many extensions installed :-(

Revision history for this message
Sleek (sleekism) said :
#8

I did not change anything but it started working again.. No idea why.. I'll mark this as solved as its not a Sikuli issue.