Posts: 6
Threads: 3
Joined: Mar 2009
Reputation:
0
03-23-2009, 03:35 PM
Hi,
Can anyone please help me.I am trying to open a saved notepad file,search a particular string,edit it,save the file and closes it.
How to do that in QTP?
Posts: 424
Threads: 10
Joined: Aug 2011
Reputation:
0
10-20-2011, 05:59 PM
(This post was last modified: 10-20-2011, 06:09 PM by Ankesh.)
Hi All,
I know its an old post bt i am having same issue.
Can u tell me how to save the notepad after editing. I am using file system object.
Regards,
Ankesh
i have another issues. I have a notepad which contains only one single line. My objective is to replace the existing line with the new line and save the file.
Any help would be appreciated.
Regards,
Ankesh
Posts: 275
Threads: 4
Joined: Jul 2011
Reputation:
0
10-20-2011, 06:31 PM
(This post was last modified: 10-20-2011, 06:32 PM by rajpes.)
1.It is automatically saved when you perform those write operations
2.One way is, read all contents of notepad(ReadAll) into a string var.
Then replace(var,"oldstring","new string").
Get the file name in some other variable.delete the file.create a new notepad with same name and fileobj.Write var