-
Contributing Member
Opening notepad in QTP &Writing of Test Result in Notepad.
Opening notepad in QTP &Writing of Test Result in Notepad.
-
Moderator
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.
-
Expert Member
Re: Opening notepad in QTP &Writing of Test Result in Notepad.
Can you share the answer for this question what anshoo is sent to you.
-
Contributing Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules