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

What do you mean by iteration?

632


Define Environment Variable in UFT and its uses?

612


What are the differences between qtp and winrunner?

537


requirement is for combo box your expected value is str= "Denver.Frankfurt.London.Los Angeles.Paris.Portland.San Francisco.Seattle.Sydney.Zurich" you must get the text in combo box and need to compare them how

1481


Explain the concept of how quicktest professional (qtp) identifies object?

580






who QTP recognizes the object stored in object repository?

1667


Hi, I got error message as "object does not support this property or method: "Test.Actions" when i execute the following line of script on QTP 9.0 Dim qtApp, qtRep Set qtApp = CreateObject("QuickTest.Application") Set qtRep = qtApp.Test.Actions("Action1").ObjectRepositories Can anyone tell me where i am wrong.

1518


PLEASE TELL ME WHEN DO YOU USE THE OBJECT SPY AT RUN TIME

5964


How many ways is to parameterize the value?

621


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


Can we write winrunner language i.e TSL in QTP tool?

1479


What will be happen if i load object repository at run time, but it has already associated.

1261


Dear Friends, I having total 3+year experience in manual testing including automation testing QTP, if i am attending any interview what kind of question will i get? please help me out

1589


what are the mandatory properties for a tex boxc (scenario?)

1531


I want to test my vb.net solution file using qtp. Does Qtp test only .exe file?

1730