Comment 10 for bug 1008113

Revision history for this message
Benny Phanichkul (benny-w) wrote : Re: Windows XP: bug on focus() or switchApp?

I just took the snippet and replaced Manager and Firefox with Notepad and VLC. The following code works for me without failure on 32bit win7

a = App('Notepad')
b = App('VLC')

b.focus()
wait(2)
a.focus()
wait(2)
b.focus()
wait(2)
a.focus()
wait(2)

@Raiman, I tried manually opening a Firefox window (no other tabs open) and attempting to switch back and forth with VLC and it fails when switching from VLC to Firefox the 2nd time (ie the second a.focus() fails). Here's the snippet I used and also the log.

Snippet
-------------------
a = App('Firefox')
b = App('VLC')

b.focus()
wait(2)
a.focus()
wait(2)
b.focus()
wait(2)
a.focus()
wait(2)

Log
------------------
[log] App.focus VLC(0) #0

[log] App.focus Firefox(0) #0

[log] App.focus VLC(7332) #0

[log] App.focus Firefox(6624) #0