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

when we enter url,one page should open.write a vb script ,that page is open or not

2 Answers   Blue Chip India, Persistent,


What is test fusion report?

2 Answers   CIL,


Tell me Three major differences between QTP & Winrunner?

2 Answers  


Without integrating QC/Testdirector with QTP, is it possible to keep track of the defects?If yes how? How to export QTP results to an excel sheet?

0 Answers  


Explain how Selenium is different from UFT?

0 Answers  






What’s the QTP testing process?

1 Answers  


On what basis we select test cases to automate?

0 Answers  


www.icici.com ,after this.. home page wll came, in this page what r the items we r going to test for manual and what are items we r going to test for QTP... explian clearly with example

0 Answers   TCS,


How will you set a unique four digit number in an edit field in QTP?

2 Answers   IBM,


How to break the object spy ?

0 Answers  


i need to learn the descriptive programming very well so for that what to do am reading the qtp user mannual but it is not so any materials or links with examples i want please help me

2 Answers  


What does VBS file contain...??? what is VBS file.. ???

6 Answers   GE,


Categories