haripotter’s technorati

Just another WordPress.com weblog

How do we send email from QTP ?

We can send an email from a QTP testscript by using the below function. It uses CDO.Message object to perform that action. We use the SMTP Server to deliver the email message to the concerned email ID. Please update the values as per your environment. This function sends a email attachment to specified email address.
Read more »

August 8, 2008 Posted by haripotter | General, HP Quality Center and QTP | , , , | 3 Comments

How to reboot a Windows System using WMI ?

If you know the administrator password of a system that you are authorized to use, you can use this function to reboot it for some automation needs. please do not try this on systems that you are not authorized to use. I have shown only the function definition here. You can use this in a QTP function library.
Read more »

August 6, 2008 Posted by haripotter | Uncategorized | , , | No Comments Yet

How to map a network drive using vbscript ?

Sometime back I posted a code to disconnect a network drive using vbscript. Now here is the code to map a local drive to a network path. This again uses WScript.Network object to map the drive. We use the filesystem object to determine if the drive is already mapped. if yes, then disconnect it first and then map it to specified path. There are two functions. One will parse the arguments to make sure right number of parameters are passed to the script. Enjoy.
Read more »

August 5, 2008 Posted by haripotter | General | , | No Comments Yet

How do we use QC as Shared repository… ?

There was comment posted in this blog asking if we could use QC as a shared repository to store file and update it directly, without downloading to local desktop. I’m afraid that it is not possible to do without downloading the file to local desktop. But We certainly can use QC as a shared repository to store files and have it accessible to many tests. There are cases when multiple QTP tests may have a need to access the same file which is stored in the test’s project repository in QC. When we attach the file to a test, other tests will have to access this attachment through this test. Alternatively, a copy of the same file could be attached to each and every test. That would be a maintenance nightmare. So what would be the solution ? Read on…
Read more »

August 3, 2008 Posted by haripotter | HP Quality Center and QTP | , , , | No Comments Yet

How to disconnect a network drive using vbscript

Below is a script to disconnect a network drive using vbscript. We employ the services of WScript.Network object to do the same :) Enjoy!. There are two functions below. One is the actual disconnect drive and the other one is to parse the command line arguments. We want to make sure the drive letter that has to be disconnected, is specified as an input parameter to the script.
Read more »

August 2, 2008 Posted by haripotter | HP Quality Center and QTP | , , , , , | No Comments Yet