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

1.How do u prepare the test suits in QC? 2.How do u convert requirements to test plan in QC?

0 Answers  


How do you know the location Id of an object if you know its index id?

0 Answers  


how can we know the program is testing by multiple test data in data driven frame work?

1 Answers   CTS,


Plz someone tell me about user interface testing and backend testing and hw did u use it in ur project.plz give a detail answer i need to explain it to the interviewer. plzzzzzzzzz guys its urgent

2 Answers  


What are the differences between table and db checkpoints?

0 Answers  






While spliting an action in QTP 10.0 getting an error : "This Line is a part of Script Block.You cannot split the action on this line." how to re-solve this and split the script into actions?

0 Answers  


How the exception handling can be done using quicktest professional?

0 Answers  


what is the difference between xmlutil and xmlDOM in qtp?

2 Answers  


Is there any pdf or online book for QTP Scripting? Let me know more about QTP Scripting.

0 Answers  


What is the use of Accessibility check point?

3 Answers  


i want to learn testing tools what i have to know before.iam fresher i dnt know any this..which langagues i have to before testing.

2 Answers   Wipro,


What is your role and responsibilities in QTP with your current organization?

1 Answers   Oracle,


Categories