how to use command prompt using qtp?

Answer Posted / mahi

using "Wscript.Shell" object we can work on command prompt
in qtp.

'create one instance for "wscript.Shell"
set oShell=CreateObject("Wscript.Shell")
'using run method we can invoke application
'/k this will display command prompt.we can also use /c but
we can not see command prompt.It will disappear after
executeion.
oShell.Run "cmd /k dir"
'if we want use multiple commands we can use "&"(amp) symbol
oShell.run "cmd /k dir & md qtp"
set oShell=Nothing

I hope it will useful.
Regards,
Mahi.kotike@gmail.com

Is This Answer Correct ?    9 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to give a call to another action from one action?

629


Discuss the QTP Environment?

628


How many types of trigger events are there in qtp?

549


Why we load add-ins in qtp?

624


what is the advantages and disadvantages of using functions instead of re usable actions

1427






What is system testing and what are the different types of tests you perform in system testing?

599


How do we analyze the checkpoint results?

581


Why do you create a text checkpoint on a Web application? What is the purpose of the Close method?

1357


Explain the views in the QTP GUI?

619


How to capture dynamic values in load runner and how Each of the captured values are to be written to a text file (c:\temp\LoadRunner1.txt)

1734


please give me the code for doing retesting of gmail login page using functions so the function has to give the value

1546


How many ways is to parameterize the value?

615


How can we use the "CreateObject("Shell.Application")" in QTP and what is the definition and purpose of it?

3055


What is a data driven test in qtp?

585


Key word driven framework

1683