Here is the code: To create Class in vbscript and use it in QTP
Just would like to share how to create Class in vbscript and use it in QTP.
Create file c:\test1.vbs
Enter the below code into test1.vbs file.
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Class ShowName
Set objFname = New ShowName
objFname.FirstName = "Prashant"
End Function</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Open qtp and type following.
Expected Result: MessageBox will come with Prashant
Re: Here is the code: To create Class in vbscript and use it in QTP
Thanks for that but I still can't see where using classes in QTP is the best thing to do. Environment variables and dictionary objects are simpler to use.