OPening of notedpad in QTP to write and execute the coding?

Answers were Sorted based on User's Feedback



OPening of notedpad in QTP to write and execute the coding?..

Answer / nanda

set fso = createobject("scripting.filesytemobject")

file_path = "c:\nanda.txt"
forwriting =2
forreading = 1
set notepad = fso.createtextfile(file_path,forwriting)
notepad.writeline "this is created by Nanda"
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

this script will create a notepad and write data and read
data in that file.

If any queries...
nanda.dreddy@gmail.com

Is This Answer Correct ?    3 Yes 0 No

OPening of notedpad in QTP to write and execute the coding?..

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 ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

What is quick test pro? What is a quick test professional?

0 Answers  


How does qtp identify gui object?

0 Answers  


i have a doubt can anyone tell me where are scripts stored while using QTP.Tell me the exact procedure takes place in real time?like how we call scripts how to proceed after writing scripts?how scripts are executed etc?i heard some use Qc whether others dont use.so tell me whole procedure for both the things it will be a very big help.as i have interview i want to have whole idea on this.its very urgent.

0 Answers   RR Donnelley, RRDonnelley,


Hi All, I have QTP installed on my machine but the application under test (AUT) is on remote desktop (i.e. I first connect to remote desktop from my machine in order to run the application). I am able to record the script successfully with QTP running on my machine and application running on remote. However, when i run the recorded script, system fails to run it and indicates me that it does not identify the object. Is it possible to record and play while QTP and AUT are not on same machine?

7 Answers   ABC,


WHAT IS THE DESCRIPTIVE programming when it is useful? & when to use this ?

2 Answers  






Hi could some one explan what is the use of the function Defination generator, And how to use the function defination generator.. Explan with the example..

0 Answers  


Explain synchronization types in QTP

2 Answers  


using descriptive programming how to close all opend browsers?

7 Answers   Satyam,


how will we run batch tests in qtp what is the process to run the multiple test sets?

3 Answers  


when I was doing the web testing with QTP using with standard checkpoint the Object selection -checkpoint properties dialog box not displaying pages and links hierarchical order. Could you please tell me. thanks

0 Answers  


What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?

0 Answers  


Apart from VB script What are the fundamental criteria to gain the knowledge to write QTP script without OR and recording ?

2 Answers  


Categories