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

Answers were Sorted based on User's Feedback



How can we use the "CreateObject("Wscript.Shell")" in QTP and what is the defi..

Answer / 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

How can we use the "CreateObject("Wscript.Shell")" in QTP and what is the defi..

Answer / hemakumar.m

For perfoming keyboard operations "Wscript" is use full.

Eg:For Pressing "F5"

Set Object=CreateObject("Wscript.Shell")
Object.SendKeys "{F5}"

U can find this in qtp help.

Is This Answer Correct ?    10 Yes 4 No

Post New Answer

More QTP Interview Questions

what type of test cases tou will automate?

4 Answers   Google,


How do you start automating/ writing your QTP scripts ?

3 Answers   Keane India Ltd,


what is difference betweein qtp 9.0 and 9.2

1 Answers  


what we do after completion of functional and regression testing

2 Answers  


what is bultin funtaion in QTP &tell me five examples?

5 Answers   Kanbay,


Hi Friends, Can any one answer this question? 17) What method is used to retrieve the number of columns in the query results? A. Fields.Count B. Fields.Item(EOF) C. Fields.Count(BOF) D. Fields.Count.Value

2 Answers  


why text area checkpoints cannot used for web applications

0 Answers  


I know the Basic QTP. But I wanted to learn descriptive programming in QTP. Without Object Repository how we can develop a script? I wanted to do one real time project using QTP. If you know this type of training is available in pune then let me know the address.

0 Answers  


What is the difference between Call to Action and Copy Action.?

2 Answers  


Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5

9 Answers  


I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?

0 Answers  


what is difference between calling a function and reusing an action?

1 Answers  


Categories