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

How to associate shared object repository to test in qtp?

0 Answers  


Can anybody give the script of below things. 1. Add sheet 2. Adding columns 3. Set the values in that columns(In the rows) 4. Close the sheet 5. How can we create 3 sheets in one Excel sheet??

2 Answers   TCS,


What is action?

0 Answers  


How do I lauch my test website using code from qtp in different environmet, uat and PPTE?

0 Answers  


How to check feasibility of the appliction?in automation testing?

0 Answers   CTS,






How can we do Data driven testing Using For loop in QTP?

2 Answers  


How you automate test scripts

1 Answers   Novartis,


How many actions we can write in a test?

7 Answers   TCS,


What is chaild object method? When we will go for chaild object method? How to use chaild object method?

2 Answers  


what are the Common Problems in S/w development process

1 Answers  


Difference between test object and run time object?

0 Answers  


How to test login page by using QTP

6 Answers  


Categories