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 difference between testing and debugging?
What are the types of Object Repository’s in QTP?
Can any body help me to write descriptive program to find a cell value (say 2 row, 3rd column) in a datatable which is creating dynamically and statically
What is the maximum size of Object Repository in QTP 8.2?
w is time parameter
what is the script to select 2 or more than 2 options from a listbox.
What are the key elements available in test result window?
How to run an integrated test scenario using Multiple Actions? How to use the QTP Step Generator?
if full in Object Repostoiory then how to load other Object Repository
Hi there, I've installed a trial version of QTP to see if it works with my product but I cant automate selecting windows from a tree view? Can anyone give me any pointers? Many Thanks
how can we retrieve ten rows from the data table using loop concept?
how can you do retesting (datadriven test) using notepad amd by using functions NOTE u should not use datatable methods