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

Dear Friend, I am New in QTP 10 so can any one tell me how to do QTP testing on WEB APPLICATION while writing VBScript. If Possible then Give Example how to write vbscript in QTP to test WEB Apllication. Vishal Patil

2 Answers  


How to write business scripts using object repository with different scenarios

0 Answers  


why we use sendkey method in qtp?

2 Answers   ABC,


what is the extension of action script template?

7 Answers   Capco,


How can we disable smart identification at the time of recording? Ideally, smart identification should be enabled only at the run-time.

3 Answers  


Diff b/w test scenario's and test Procedures?

0 Answers  


What is the difference between Systemutil.run and Navigate.

6 Answers   Synechron,


Hi, I want to write the script for a webpage. But i didn't added the properties of the objects to the object repository. Without adding the object properties to the object repository, how to write the script. When i am writing the script, Let us say i typed as Browser (""). after selecting ".", if the object is added to the object repository it will display atomatically. But in my case it is not as i didn't added the object properties. How to proceed further in the above mentioned case to write the script manually. Pls let me know if you didn't understand the question.

3 Answers  


can any body tell me all of the release dates of QTP?????..... thanks in adv!

3 Answers  


What is the use of text output value in quicktest professional (qtp)?

0 Answers  


tell me types of environment variables? what r they? explain details? pls give anwer any one?

2 Answers   IBM,


when qtp recognizes a web link like (hyper link)wich properties it is going to take to identify the objects unquely? what is Ini file in QTP?

1 Answers   Symantic Space,


Categories