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

can i compare two databases using QTP ?

2177


How to find array size in qtp?

789


Explain the concept of how quicktest professional identifies object?

765


Is QTP supports Unix. If yes, then how the test automation is done?

1966


Thanks....But can u tell me how i use the QTP for GIS with one Example...

1677


what is the difference betn QTP 8.0 AND PREVIOUS VERSION

2220


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

1720


What is an expert view and keyword view?

830


Whether qtp 9.0 supports Test director8.0

2362


when u script reveiwing in which area u more concentrates?

1665


I have created 3 actions in test action1, action2, action3 but I want run action 1,action 3,action2 how can you change in the actions in keyword view?

857


Hi Friends, Would be great if you can provide the Model Question paper, Web site link or any reference s. Thanks & Regards, Byzoor,

1587


Is it possible to change the property value at runtime? How it is possible?

795


What are the views available in qtp?

829


There is an excel file of 1 to 100 sheets how you will iterate through it?

782