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

Answer Posted / mahi

If we want to work on operating system related functions
(like command prompt,windows registry....) then we go
for "Wscript.Shell".Actually this is vbScript class. WE can
not directly use this in qtp. For that one we need to
create one instance firstofall. Using CreateObject we can
create instance as followes.

Set oShell=CreateObject("Wscript.Shell")
oSehll.popup "Have a great day"
oShell.Run "cmd /k dir"
oShell.sendkeys "{ENTER}"
set oShell=Nothig

I hope this may useful.
Regard,
mahi.kotike@gmail.com

Is This Answer Correct ?    29 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how do we know whether all objects are stored in the object repository or not? how can we know if a particular object is not stored in the repository?

1312


How to creating an output value using quicktest professional (qtp)?

568


How to associate shared object repository to test in qtp?

506


RECENTLY I PLACED IN QTP..HOW TO IMPROVE VB SCRIPTS KNOWLEDGE? IAM STRUGGING TO WRITE THE AUTOMATION SCRIPTS? ANY BODY TELL HOW TO IMPROVE QTP SCRIPT SKILLS?

2184


Hi Friends this is kumar i would like to request to all of you ,please help me to explain real time project with using qtp scripts i know basics of qtp but it won't workout on interviews,pls help awating to reply.

1372






Have you done batch testing in qtp? If yes how you are doing?

509


Which scripting language used by quicktest professional?

530


What is meant by Step generator?what is the use of this? we have 3 steps know there what r all those.? can u all pls give me clear idea of this

1403


How to find a window is minimized or not

1446


Key word driven framework

1686


Differentiate the type of test cases which can be automated and which cannot be automated?

567


can anyone tell me what to say in interview when interviewer asks about "tell me about your framework in your project"?

1404


Mention the test steps of qtp.

541


In qtp, how you can exit for loop?

527


For which type of projects the iterative model is not suitable?

1435