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
How to find operating system information using the qtp script?
Explain how you can find length of array in qtp?
Explain in brief about the quicktest professional (qtp) automation object model?
Explain quicktest professional testing process?
How to run a test using quicktest professional?
How did you use regular expressions in QTP and also in WR?
What will be happen if i load object repository at run time, but it has already associated.
Dear All, How to generate Pass or Fail Report in QTP without using Reporter.Report Event Method ? Thanks Balaji
Discuss the QTP Environment?
How to handle dynamic objects in quicktest professional?
what is actually contain test report? can anybody post the test report
What are the benefits of quick test pro(qtp)?
Is QTP supports Unix. If yes, then how the test automation is done?
What is the difference between Keyword Driven test and Data Driven test?
What is the basic concept of quicktest professional (qtp)?