Micro Focus QTP (UFT) Forums
Selecting file saved in a location - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Selecting file saved in a location (/Thread-Selecting-file-saved-in-a-location)



Selecting file saved in a location - excellentpawan - 02-24-2014

Hi,
I am working on a desktop application.

Suppose i want to open a file in paint which is in "D" drive in a folder. If i try to record, it records in co-ordinates and on execution it make problem.
Code:
Window("Paint").WinObject("NetUIHWND").Click 43,45
Window("Paint").Window("Window").WinObject("NetUIHWND").Click 65,81
Window("Paint").Dialog("Open").WinTreeView("SysTreeView32").Select "Desktop;Computer"
Window("Paint").Dialog("Open").WinObject("DirectUIHWND").Click 348,63
Window("Paint").Dialog("Open").WinObject("DirectUIHWND").Click 348,63
Window("Paint").Dialog("Open").WinObject("DirectUIHWND").Click 119,167
Window("Paint").Dialog("Open").WinObject("DirectUIHWND").Click 119,167
Window("Paint").Dialog("Open").WinObject("DirectUIHWND").Click 302,220
Window("Paint").Dialog("Open").WinObject("DirectUIHWND").Click 302,220
Window("Paint").Close

If i try to create descriptive code it identifies as winobject when i go to open folder. I want to write vb code not recording method

Please help


RE: Selecting file saved in a location - guin.anirban - 02-25-2014

Use FileSystemObject instead