Forum Discussion

Morgan's avatar
Morgan
Frequent Contributor
12 years ago

Selecting the application in the tray

I have a strange problem...



I modified the script located here to click on an item in the tray.  When this icon is clicked, it launches a menu and from there I want to select an item from that menu.



However, I find that RIGHT after my tray application is launched and appears in the tray, TC cannot locate it and fails with the error that the control item 'APPNAME' was not found.  Bolded below is where it fails.  Odder still is if I MANUALLY click the tray icon and then the menu, TC can THEN successfully locate the tray item.  It is only when the tool is first loaded and first appears in the tray that this is an issue.



Any thoughts?



This is 8.7 on an XP machine, if it makes a difference.



Thanks,

Morgan

--------




Sub RightClickTrayIcon(Name, MenuItem)


'Expands the tray and accesses the application


    Set p = Sys.Process("Explorer")


    Set tray = p.Window("Shell_TrayWnd").Window("TrayNotifyWnd")    


    Set show_button = tray.WaitWindow("Button", "")


    aqUtils.Delay(1000)


   


'Right-clicks the application icon    


    tray.Window("SysPager").Window("ToolbarWindow32", "Notification Area").ClickItemR(Name)  


         


'Selects an item from the context menu                    


    tray.PopupMenu.Click(MenuItem)


    Delay(1000)  


End Sub

  • Morgan's avatar
    Morgan
    Frequent Contributor
    Just for kicks, I ran this in Windows 7 on 8.7 AND then upgraded there to the latest TC9 and see the same problem.



    Interestingly, on the 'Additional Info' tab of the log, I see the following...



    Total number of items: 4.

    Items: 'Remote Audio: 100%', '', 'local Internet access', 'Solve PC issues: 3 important messages

    4 total messages'.



    So you'll see item 2 in the list is where the application should be - it shows ''.  If I hover over the icon in the tray, however, I see the application name I am trying to click.



    Really odd.



    Thanks,

    Morgan