2

I'm using White for UI automation and it was working fine until I met an app that was created in Java. In that case I'm unable to find any windows. If I get all Windows from the desktop then I can see the window's name I'm looking for:

List<White.Core.UIItems.WindowItems.Window> windows = new List<White.Core.UIItems.WindowItems.Window>();
windows = White.Core.Desktop.Instance.Windows();
int a = 0;
for (int i = 0; i < windows.Count; i++)
        if (windows[i].Name == "HP Service Manager Client") a = i;

This is working, but if I attach the running process and try to get its windows, then I get nothing, the list will be empty:

windows=app.GetWindows();

This is the code that should find the main window:

var processes = Process.GetProcessesByName("ServiceManager");
White.Core.Application app = White.Core.Application.Attach(processes[0]);
White.Core.UIItems.WindowItems.Window main = app.GetWindow(SearchCriteria.ByText("HP Service Manager Client"), InitializeOption.NoCache);

The error I get: Additional information: Couldn't find window with SearchCriteria Name=HP Service Manager Client in process 7396, after waiting for 5000 ms

I can see the Window in VisualUIAVerify and I know that the name of it is correct. This is the only app which is not working, IE, Firefox, etc. are all working fine, I can always identify the main window, but this time I can't find any windows at all.

I wonder if someone could explain me why it is doing this and help me to resolve this issue (or find a workaround). Many thanks in advance.

David
  • 15,894
  • 22
  • 55
  • 66

0 Answers0