Explain about opening notepad in QTP and writing of test
result in notepad?
Answers were Sorted based on User's Feedback
Answer / sailaja
Hi
The above ans will error message at for loop.
This will work fine.
Dim fso,notepad
set fso = createobject("scripting.filesystemobject")
file_path = "c:\nandu.txt"
'forwriting =2
'forreading = 1
set notepad = fso.createtextfile(file_path,1)
notepad.writeline "this is created by Nanda"
notepad.writeline"this is created on "
set notepad = fso.opentextfile(file_path,1)
Do
n = notepad.readline
msgbox n
Loop until ( notepad.atendofstream=true)
Thank you
Sailaja
Is This Answer Correct ? | 14 Yes | 2 No |
Answer / shyam.meghansh
systemutil.Run("C:\WINDOWS\NOTEPAD.exe")
Window("Notepad").WinEditor("Edit").Type "Hi This is shyam "
Window("Notepad").WinEditor("Edit").Type micCtrlDwn + "s" +
micCtrlUp
Window("Notepad").Dialog("Save As").WinEdit("File
name:").Set "demo"
Window("Notepad").Dialog("Save As").WinButton("Save").Click
'..........Any more question mail me
testingwithshyam@gmail.com
Is This Answer Correct ? | 10 Yes | 1 No |
Answer / ajreddy
set fso = createobject("scripting.filesytemobject")
file_path = "c:\ajreddy.txt"
set notepad = fso.createtextfile(file_path,forwriting)
notepad.writeline "hi ajreddy"
notepad.writeline "this is created on "& now
notepad.close
set notepad = fso.opentextfile(file_path,forreading)
for notepad.atendofstream
n = notepad.readline
msgbox n
Next
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / narendrababu
In qtp directly we con't open notepad.so,create an object
first(fso),through this obj we can access notepad.
to create an obj
set fso =create object(scripting.filesystem object)
set x= fso.opentextfile()
Is This Answer Correct ? | 3 Yes | 5 No |
What is the basic concept of quicktest professional (qtp)?
What is the difference between Recover Scenario(screen) and on Error Resume Next(code)
How to get the column count and column name from the resultset in the database connection program?
On the website, the protocol has been changed https: to https what you will do? Tell me your approach?
what is ODC and GDC?
why do we go for Test Automation?
What are SetToProperty, SetRoProperty, GetToProperty scripting?
Why do we use "Text checkpoint" If we can make use of it in "standard checkpoint" ?
Both static and dynamic arrays are handled by the vb script. Is it true?
I have two actions in my QTP test and two iterations in my DataSheet. I want to execute the Action 1 for the two iterations only after which i want to exceute the next Action2. How is this possible?
Did you face the problem, changing the properties of an object in Run Time?
i need qtp tutorial. pls send it to sridhar.k151@g mail.com