Geeks Talk

Prepare for your Next Interview




Opening notepad in QTP &Writing of Test Result in Notepad.

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....


Go Back   Geeks Talk > Software Testing > QTP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-07-2008
Contributing Member
 
Join Date: Feb 2008
Location: newdelhi
Posts: 49
Thanks: 8
Thanked 3 Times in 2 Posts
suneetham is on a distinguished road
Opening notepad in QTP &Writing of Test Result in Notepad.

Opening notepad in QTP &Writing of Test Result in Notepad.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-07-2008
Moderator
 
Join Date: Oct 2007
Location: Frankfort, KY
Posts: 283
Thanks: 3
Thanked 51 Times in 36 Posts
Anshoo_Arora is on a distinguished road
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.
Reply With Quote
  #3 (permalink)  
Old 02-08-2008
Contributing Member
 
Join Date: Sep 2007
Location: Hyderabad
Posts: 93
Thanks: 1
Thanked 14 Times in 13 Posts
rajaputra is on a distinguished road
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.
Reply With Quote
  #4 (permalink)  
Old 02-08-2008
Contributing Member
 
Join Date: Feb 2008
Location: newdelhi
Posts: 49
Thanks: 8
Thanked 3 Times in 2 Posts
suneetham is on a distinguished road
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.
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP


Thread Tools
Display Modes


Similar Threads

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


All times are GMT -4. The time now is 08:10 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved