Micro Focus QTP (UFT) Forums
Qtp identifies any files in 'SysviewList 32' as folder View - 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: Qtp identifies any files in 'SysviewList 32' as folder View (/Thread-Qtp-identifies-any-files-in-SysviewList-32-as-folder-View)



Qtp identifies any files in 'SysviewList 32' as folder View - swati - 12-06-2010

Hi,
I wrote the following script for 'open' Dialog box in QTP 11.when user open the dialog box there is folder as well as files. I want to open only file with the help of qtp.
This is the script for above functionality.
Qtp unable to identify the difference between files and folder.It diplays message 'Folder View" evenif it selects File. (Lines in red)I tried same logic for 'Open dialog box in Microsoft excel', but i got the same result.

Pls Help me nd pls correct me if there is mistake in the script.

Thanks
Regards
Swati

Code:
Window("WinPREP®").Dialog("Open").WinButton("Open").Click
listm=Window("WinPREP®").Dialog("Open").WinListView("SysListView32").GetRoProperty("items Count")
MsgBox listm
For i=0 to 5
Window("WinPREP®").Dialog("Open").WinListView("SysListView32").Select i
[color=#FF4500]itemname=Window("WinPREP®").Dialog("Open").WinListView("SysListView32").GetROProperty("text")
msgbox itemname[/color]
If itemname ="*.MPT"  Then
Window("WinPREP®").Dialog("Open").WinButton("Open").Click
windowtlt=Window("WinPREP®").GetROProperty("text")
MsgBox windowtlt,
End If
Next