Micro Focus QTP (UFT) Forums
Unable to save notepad file using descriptive prog. - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Unable to save notepad file using descriptive prog. (/Thread-Unable-to-save-notepad-file-using-descriptive-prog)



Unable to save notepad file using descriptive prog. - vimal singh - 12-20-2009

Code:
systemUtil.Run "Notepad.exe"
Window("text:=Untitled - Notepad").WinEditor("object class:=Edit").Type "hi this is my first script"
Window("text:=Untitled - Notepad").WinMenu("menuobjtype:=2").Select ("<Item 1>;<Item 3>")
Window("text:=Untitled - Notepad").Dialog("regexpwndtitle:=Save As").WinEdit("Class Name:=WinEdit","enabled:=True","object class:=Edit","text:=*.txt"). Set "C:\Users\pratima\Desktop\first_script.txt"
'Unable to set the file name..please help me
Window("text:=Untitled - Notepad").Dialog("text:=Save As").WinButton("nativeclass:=Button","text:=&Save").Click
Window("text:=first_script").WinMenu("menuobjtype:=2").Select ("<Item 1>;<Item 7>")



RE: Unable to save notepad file using descriptive prog. - Saket - 12-21-2009

try replacing this in your statements
Code:
Window("text:=Untitled - Notepad").Dialog("regexpwndtitle:=Save As").WinEdit("nativeclass:=Edit").Set "C:\Users\pratima\Desktop\first_script.txt"



RE: Unable to save notepad file using descriptive prog. - vimal singh - 12-21-2009

Thanks buddy.. it did work.. it just asked for additional property..

Once again .. thanks for your promp reply