06-22-2017, 04:55 PM
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 .. !!!
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 .. !!!