Interview Questions   Tutorials   Discussions   Programs   Videos   

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




273
views
asked marvit August 21, 2014 01:40 AM  

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


           

1 Answers



 
answered By Dharma   0  
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 first of all. Using CreateObject we can create instance as follows.

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

Your answer

Join with account you already have

FF

Preview

 Write A Tutorials
Online-Classroom Classes
www.writeabc.com


  1 person following this question

  1 person following this tag

  Question tags

qtp × 1

Asked 3 years and 5 months ago ago
Number of Views -273
Number of Answers -1
Last updated
3 years and 3 months ago ago

Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert