Micro Focus QTP (UFT) Forums
Cannot identify the specified item - 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: Cannot identify the specified item (/Thread-Cannot-identify-the-specified-item--8909)



Cannot identify the specified item - Beginner - 06-22-2017

Hi ,

I am totally new to QTP. The very first script that I am trying to run is to open,Edit and save a notepad file .
But I am getting below error :
Cannot identify the specified item of the WinTreeView object. Confirm that the specified item is included in the object's item collection.

Below is my code snippet :

SystemUtil.Run "C:\Windows\system32\notepad.exe","","%HOMEDRIVE%%HOMEPATH%",""
Window("Notepad_2").WinEditor("Edit").Type "rjkur"
Window("Notepad_2").WinEditor("Edit").Type micCtrlDwn + "s" + micCtrlUp
Window("Notepad_2").Dialog("Save As").WinTreeView("WinTreeView").Select "Favorites;Desktop"
Window("Notepad_2").Dialog("Save As").WinEdit("File name:").SetSelection 0,5
Window("Notepad_2").Dialog("Save As").WinEdit("File name:").Set "gfg"
Window("Notepad_2").Dialog("Save As").WinButton("Save").Click
Window("Notepad_2").Close

If anyone can help me in this please .

Thanks in advance .. !!!