← Back to team overview

sikuli-driver team mailing list archive

[Bug 809801] Re: switchApp() try to launch the application ( as openApp() )

 

For Mac: This is not really a bug, since switchapp() does not remember
the apps name used with openApp(). And it is not always the text you see
in the menu bar, that has to be used with switchApp() (e.g. NetBeans
shows up in the menu bar, but it is "Netbeans 6.9" that you have to use.

You should use the new App class, which gives some more options
especially on the app windows and "knows" the app once it is opened.

ws = App("/Users/Poste8/Desktop/Widgets/testWidgets/wakanda/Wakanda Studio.app") # a new app object
ff = App("Firefox")

ws.focus() # opens wakanda app if not open already
while not window():
     wait(1) # we wait for the window to be ready
# now you are sure, your wakanda app has focus

ff.focus(); wait(1) # switches to Firefox
ws.focus(); wait(1) # switches back to wakanda

-- wait(1) after focus(): my experience on Mac with app switching is
that you most often have to wait a short time (0.3 to 1 second) for the
window to get ready. This is only needed if a type() or paste() follows
directly. find() and click() are no problem, since they have the
internal 3 seconds waiting time.

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/809801

Title:
  switchApp() try to launch the application ( as openApp() )

Status in Sikuli:
  New

Bug description:
  User Sikuli Version : X-1.0rc2
  OS: Mac OS 10.6.6 64-bit

  when i try to execute this :

  openApp("/Users/Poste8/Desktop/Widgets/testWidgets/wakanda/Wakanda Studio.app")
  wait(5)
  switchApp("Firefox")
  switchApp("Wakanda Studio")

  Sikuli open the "Wakanda Studio.app" and switch to "firefox"
  correctly, then it try the open "Wakanda Studio.app" again !   , which
  is weired because it is supposed to only display the "Wakanda
  Studio.app" frontmost

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/809801/+subscriptions


Follow ups

References