Explain about opening notepad in QTP and writing of test
result in notepad?

Answers were Sorted based on User's Feedback



Explain about opening notepad in QTP and writing of test result in notepad?..

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

Explain about opening notepad in QTP and writing of test result in notepad?..

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

Explain about opening notepad in QTP and writing of test result in notepad?..

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

Explain about opening notepad in QTP and writing of test result in notepad?..

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

Post New Answer

More QTP Interview Questions

where did you automate in your project?(please tell me example senarios)

2 Answers  


If you have given 1000 manual test scripts, what test you will do? and how?

2 Answers  


How to supress warnings from the "Test results page"?

4 Answers  


How to compare the two strings?

2 Answers  


I want to run my qtp scipt on the system where qtp is not installed .I don't want to install qtp but i want that system should use the qtp from another system in lan just the qtp instance should be launched on that system without having qtp installed on it .I probably know the solution that it will be solved through RMI but how to get this problem solved plz help i anyone know the answer

4 Answers   Cimcon,






How you know that a test case is a regression test case

1 Answers  


Pls can anyone give me the entire code for the Keyword driven framework with respect to he Flight Reservation Window in detail with explanation. Pls explain in detail stepwise. Thanks a lot. Pls very urgent?.

0 Answers   Logix,


we have 10 more actions in our test and we are using exit action command to come out from the action if any error s occured.In action 1 if any error occurs control is moving to second action but if we get error in second action exitaction is throwing general run error. Please give a idea to overcome .

1 Answers   TCS,


IF THE GUI OF APPLICATION IS CHANGED THEN IS THERE ANY NECISSITY TO CHANGE OR UPDATE OUR TEST SCRIPTS

2 Answers  


How the automated tests in org

1 Answers   Maintec,


what is framework? which frame work u follow for writting script?

5 Answers   IBM,


What is the difference between "Call to copy of action", "Call to existing action" & "Call to winrunner action"?

5 Answers  


Categories