Highlighted
Honored Contributor.
Honored Contributor.
482 views

UFT 14.02 to access the objects in the system tray

Hello friends.

Recently started to tes t a WPF application that resides int he system tray. I open it using the common SystemUtiil.Run command but it immediately goes to the system tray. In order to invoke the main application screen I must hover (or click) the appl's icon and then the screen will appear.

I found a code snippet in the web but that did not work at all. F10 did nothing in replay.

Can anyone give a hand here?

UFT 14.02 with WPF and Web Addins loaded. Windows 7 Enterprise +SP1.

 

 

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: UFT 14.02 to access the objects in the system tray

hi, there

if after you launch the application, the icon appears on the tray 100% sure, you may try Insight object to find it.

Thanks.

James

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: UFT 14.02 to access the objects in the system tray

Hi James.

 

I do not wish to rely on BMP or insight objects. In fact, I have this code that iterates through the system "window" (identifiable in UFT)

' Launch the PIPE - 2017 application through the system util
systemutil.Run "C:\Program Files (x86)\PIPE2017B\PIPE2017B.exe"

num_of_icons = Window("Task_Bar").WinToolbar("System_Tray").GetItemsCount
name_to_find = "pipe"
For i = 1 To num_of_icons
    name = Window("Task_Bar").WinToolbar("System_Tray").GetItem(i)
    If InStr(name, name_to_find)>0 Then            
        Window("Task_Bar").WinToolbar("System_Tray").Press i, micLeftBtn

        Exit For
    End If
next

Now, I have to figure out hopw to simulate a hover action over that icon, perhaps FireEvent??

 

What say you ?

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.