Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Identifying objects on Desktop
#1
Solved: 10 Years, 8 Months, 3 Weeks ago
I am trying to open a particular application thru the Desktop but am unable to identify any object (individually) on the Desktop. I am only looking for desktop objects, not the windows that are already open. On using below code, i was able to get the count of objects on the desktop, but still not able to identify any of them:

Code:
intCount = Window(objWindow).WinListView(objWinListView).GetItemsCount

Could you help in identifying and opening an object on the desktop? Ideally if there was a way to identify the Icon of the application, and then activate it, that would be great. Or can we use any Ordinal identifier or hotkeys??
I am using qtp10 and Windows Vista system. Could provide more details if needed.

Thanks!
Reply
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
Hope the below help to get some idea.
Code:
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set fso = CreateObject("Scripting.FileSystemObject")
Set fol = fso.GetFolder(DesktopPath)
Set files = fol.Files
For each fil In files
  filname=Mid(fil.name,1,instr(1,fil.name,".")-1)
' replace Adobe Reader 8 with the icon name you looking for
  reqapp=(Strcomp(filname,"Adobe Reader 8"))
   If  reqapp then
   Else
  ' write you code for activate it        
   End If
Next

make sure the icon you are looking available in your personal desktop folder more than common user folder. if its not so means just copy and paste it in your desktop folder.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to deploy a desktop application to a physical server using Azure Pipelines? raivivan 0 918 04-08-2022, 04:46 PM
Last Post: raivivan
  UFT 14.01 - identifying wpf objects. but not performing action. chinmoyee 1 2,347 11-15-2017, 03:42 PM
Last Post: Ankur
  Objects identifying as WinObjects on IE with QTP/UFT santhosh kumar 5 5,222 05-07-2016, 12:39 PM
Last Post: vinod123
  QTP 10 not identifying objects in IE8 on 64 bit OS Ram2009 6 4,387 03-24-2015, 05:46 PM
Last Post: vinod123
  QTP 9.0 supports WPF based .NET desktop application. nagarajkv 1 2,521 02-27-2014, 03:48 PM
Last Post: hiregoudar

Forum Jump:


Users browsing this thread: 2 Guest(s)