Skip to main content

Posts

Showing posts from August 6, 2008

Sending Mail from QTP using OutLook

As a generic Automation requirement most of the projects look at automatic emails being sent after QTP script executes or ends in a failure. Generally,  outlook is configured on the systems on whissing Outlook from QTP. '******************************************************************************* ' Function: Outlook_SendEmail ' ' Sends an email using Outlook. ' ' Input Parameters: ' ' strTo - The email address or Outlook contact to whom the email should be sent. ' strSubject - The email's subject. ' strBody - The email's body (this may of course include newline characters). ' ' Output Parameters: ' ' None. ' ' Returns: ' ' Not applicable.  This is a sub, not a function. ' Sub Outlook_SendEmail(strTo, strSubject, strBody) 'TODO: maybe add support for CC, BCC, etc?   'Create an Outlook object   Dim Outlook 'As New Outlook.Application   Set Outlook = CreateObject("Outlook.Application...

Working with Excel objects in QTP

We create framework for automating the application. For this we need the independent structure for reporting and data. Excel plays a very important role in this approach.   QTP has its own test result displaying mechanism in the predefined format. Once the test is run, the result sheet is generated which gives you the insight of the script – stating the point of failures, warnings and passes. We create customized checkpoint in the script and it is possible to customize the result file also depending upon the checkpoint created will be passed or failed. In most of the cases we want to create summarized or detailed report of the entire test in excels. The reason to create customized report is that one is able to keep the file in central location and to create the report in our own format. In this article we are going to learn the interaction of Excel with VBScript. The whole mechanism goes in the following steps: 1. Understanding the hierarchy of Excel Application. 2. Creating the Excel ...

Database Handling in QTP using ADODB

Database handling via VBScript is basically done with following steps: 1. Creating the object of ADODB 2. Define the Connection String  for the database to connect 3. Opening the connection 4. Firing of the query 5. Accessing data with Record Set Object 6. Closing the connection 7. Release the memory occupied by the Objects.   We will go through each of the above stated steps with an appropriate example showing how the things work up in real life application. Creating the object of ADODB –     Set db = CreateObject("ADODB.Connection") Specifying the Connection String of the database to connect – Connection String related to specific connection can be set either with or without DSN (Data Source Name). In Case of DSN – You create the DSN depending upon you want to fetch the data from SQL Server, Excel, Access etc. depending upon the drivers present in your system. Say for example DSN for Ms-Access is created with name as "MyDSN" for a pre specified database selec...

What’s New with QTP 9.5?

This is the general overview giving the brief description of what is new in QTP9.5 New Features: 1.  New design time panes: Various new IDE panes have been introduced which does not provide any new functionality to add up but basically the operations which were in the deep sub menus are now put up in front. Available Keyword Pane: This pane shows all the available functions in the current test (either in-action or externally added), as well as all the objects in your object repository (local and external). The items are effectively separated into groups, making it easier to search for a relevant item. Double clicking any item in the pane will open it, and dragging the item to the main window will add it to the script in the drop position. Double clicking a function will not only open the hosting file in the main window, but also focus on the exact position of the function within the file. Test Flow Pane: This pane lays out the action call structure of the current test. It outlines...