Search code examples
automated-testscaliburn.micropywinauto

notifyiconwpf and GUI automation


I have an application that uses this application type that I need to automate. Unfortunately, the application window is invisible to my automation tools. Are there any suggested ways of working around this problem? I'm using pywinuto for automation. I can't even inspect the window data for this application.

EDIT:

from pywinauto import Application
from pywinauto import taskbar

app = Application().start("path/to/my/app")
#make the window visible
taskbar.ClickHiddenSystemTrayIcon("My App") 
#When I query the number of windows the app has.
len(app.Windows())
#I get zero windows. There should be at least one window
#because the window is currently visible.

I've also tried the findwindow methods for which I can get a WindowSpecification but it is not connected to any window.


Solution

  • In order for this app to be automatable, the developer had to wrap the NotifyIconWPF in a standard window, conditionally, depending on command line switches. Once this was done, the windows for this application became accessible to pywinauto. It looks to me like Caliburn Micro, intentionally, disabled accessibility for this window class.