Prepare for your Next Interview
This is a discussion on Opening notepad in QTP &Writing of Test Result in Notepad. within the QTP forums, part of the Software Testing category; Opening notepad in QTP &Writing of Test Result in Notepad....
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
Re: Opening notepad in QTP &Writing of Test Result in Notepad.
Please check your mailbox. I wasn't able to Indent the script property and it just showed like one paragraph. So I have mailed it to you. I will attach a word file for others to view soon.
|
|
|||
|
Re: Opening notepad in QTP &Writing of Test Result in Notepad.
Dim oFSO, oFile, strText
Set oFSO=CreateObject(“Scripting.FileSystemObject”) Set oFile=oFSO.CreateTextFile(“ExactLocationOfFile”, True) ‘Write 3 lines with 3 spaces For i=1 to 3 oFile.WriteLine “hello World” &i oFile.WriteBlankLines 1 Next oFile.Close Set oFile=Nothing Set oFSO=Nothing The original code is by Dani Vainstein. I have made some modifications. You can modify the code to do the operations you want. This code will write Hello World 3 times in a text file. You can modify it as following to write as many inputs to the text file as you want. I have modified the following code to suit your requirement: Dim oFSO, oFile, strText Set oFSO=CreateObject(“Scripting.FileSystemObject”) Set oFile=oFSO.CreateTextFile(“ExactLocationOfFile”, True) oFile.WriteLine “” &strFirstResult oFile.WriteLine “” &strSecondResult oFile.WriteLine “” &nthResult ‘oFile.WriteBlankLines 1 oFile.Close Set oFile=Nothing Set oFSO=Nothing Values from strFirstResult, strSecondResult and nthResult come from the output of your code. For eg: strFirstResult=Browser(“”).Page(“”).WebEdit(“”).GetROProperty (“name”) Now, strFirstResult will be written to the first line of the notepad file. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| GridinSoft Notepad: small, fast and powerful text editor. | JobHelper | Geeks Lounge | 6 | 03-15-2008 03:13 AM |
| Notepad Logs | csguna6 | Geeks Lounge | 0 | 11-27-2007 06:22 AM |
| Can we assign input data from Notepad to the script? | Geek_Guest | QTP | 4 | 08-02-2007 02:35 PM |
| Launch notepad file by using QTP | Geek_Guest | QTP | 4 | 04-19-2007 01:03 PM |
| I Hid The Facts in Notepad | Srikanth | Geeks Lounge | 2 | 09-20-2006 08:53 AM |