Friday, August 26, 2011

Scripting Guidelines or Coding Standards in Test Automation Script

Coding Standards are suggestions that will help you to write QTP Script code using VB Script. Naming conventions for crating QTP Script, objects, variables and procedures. Commenting standard in the scripting, Text formatting and align guidelines for the script.

The main motive for using a regular set of coding Standards is to normalize the structure and coding way of a QTP script or set of scripts, so that you and others team members can easily read and understand the QTP code.
Using good coding standards will results in accurate, readable, and unmistakable QTP Script.
Code that is consistent with other languages like Java script etc,. conventions and as sensitive as possible.

Script Organization


An example of the comment block is as follows:

you can also create a action template, with fallowing information, Click Here to see how to create a action template in QTP.

'Test Script Header
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
'@Script Name : < Name of the Script>
'@Script Description : < Description of the Script>
'@Script Author : < Jr.Siva Kumar Eanuga>
'@Email ID: < Shivakumar004@gmail.com>
'@CreationDate : < dd-mm-yyyy>
'@Last Updated Date : < dd-mm-yyyy>
'@PreCondition : < pre requisites to be used for the script>
'@Libraries : < required library files>
'@External Function Reference:
'@DataFiles : < required data files>
'@DtParam : < Name>
'@DtParam : < Name>
'@DtParam : < Name>
'@Modification : < By , Date: >
'@Description: < modification description>
'@Reviewed By : < Sr. Siva Kumar Eanuga>
'@Reviewed Date : < dd-mm-yyyy>
'@Remarks : < Additional information>
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
'-- Constant Declarations
'declare here your constants
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'--- Global Variable Declarations
'declare here your Global Variables
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'--- Local Variable Declarations
'declare here your Local Variables
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'< detailed script>

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' The End of Script
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Standards of Constant Naming

Constant names should be uppercase with underscores (_) between words.
Ex: USER_LIST_MAX, NEW_LINE

Standards of Variable Naming

For easy readability purpose use the prefixes like below examples, along with descriptive names for variables in your QTP Script code.
Ex:
String -- sName
Object -- oObjectname
Integer, Byte, Long -- nNumber
Array -- arrListitems
Boolean -- bYes
Single, Double -- fPrice
DateTime -- dToday
Error -- errResponse
Currency –- cRupees

Object Naming Standards

For the objects we create in the QTP script, we use prefix “o” (small letter o).

Ex:
ADODB.Connection -- oConn
ADODB.Recordset -- oRset
Scripting.xmlobject -- oXmlobj
Scipting.FileSystemObject -- oFsobj
Scipting.TextStream -- oTxt
Scripting.Dictionary -- oDic
Shell.Application -- oWsh
Excel.Application -- oXls

to be continued .....

Thursday, August 25, 2011

How to get Sub-folders Count and Names from a Folder?

How to get Sub-folders Count and Names from a Folder? using the below code(VB Script) you will be able get all the sub-folders in a parent folder.  This code will be very much useful in the during the creation of Test Automation Frame works.

Set Obj = CreateObject("Scripting.FileSystemObject") 
'Creating a file system object
    Set Obj1 = Obj.GetFolder("C:\test")
    Set Obj2 = Obj1.SubFolders
    msgbox Obj2.Count 'displaying count of sub-folders
    For Each Fold_Iteam in Obj2
        Fold_names = Fold_names& Fold_Iteam.name &vbnewline
Next
msgbox Fold_names 'Displaying all sub-folders names

Lock your system after execution of your QTP Script

Now you can lock your system after your QTP batch script/script execution.
use the below code at the end of your script(batch/regular). your system will be automatically locked,once after script executed.
Public Function Lock_your_system()
    Set obj = CreateObject("WScript.Shell")
    sCmnd = "%windir%\SYSTEM32\rundll32.exe user32.dll,LockWorkStation"
    obj.Run sCmnd, 0, False
End Function

Tuesday, August 23, 2011

HP QTP Certification

HP QTP certification ( HP0-M16) is mainly planned for functional testers, who are interested in to create/develop automation scripts using functional testing tool "Quick Test Professional 9.2."

From August 1st 2010, HP has come up with the New HP QTP Certification v10.0. AIS is for beginner and ASE is advanced level certification level.

New Exam Name is "Exam HPO-M39" – HP QuickTest Professional 10.0 Software.

Exam Preparation Guide from HP is available to

Download Here

and you can follow the simple instructions.The cost of the HP QTP certification now is $150.

Quick Test Professional 11.00



Quick Test Professional 11.00 is available now with the below awesome new features
ØManage Your Test Data
Quality Center (HP Application Lifecycle Management) test configuration functionality enables to determine runtime which data sets to use for your tests execution.
HP ALM test configurations enable:

  • Unbind your data from your tests
  • Share common data sources across different tests
  • Filter your data to fit your testing needs
  • Increase requirements traceability
Test data can be stored in the Quality Center Test Resources module in the form of data table resource files.
Ø Test Your GUI and UI-Less Application Functionality in One Test

“QuickTest-Service Test” integration enables to test across the GUI and non-GUI layers of the application.

We can use QuickTest steps to start testing the GUI elements in the application, then call a “Service Test” test to validate service communications (standard Web Services, non-SOAP Web Services, such as REST, etc.), and then step back into your QuickTest GUI testing, all in a single test run.
The results of the QuickTest and Service Test steps are displayed in a unified report in the new Run Results Viewer.
Ø New Run Results Viewer

The new Run Results Viewer provides an Executive Summary page with summary data, pie charts and statistics for both the current and previous runs, a quick link to the previous run results, and more.
The Run Results Viewer displays the results of your run session in a set of panes that you can show, hide, move, dock, and otherwise customize to your needs.
We can install the Run Results Viewer as a standalone installation. This enables you to share the results of your tests with business analysts and developers who do not work with QuickTest.

Ø Help QuickTest Identify Your Objects as a Manual Tester Would – VISUALLY
We can now use visual relation identifiers to identify application objects based on other objects that are always near them.
This enables to create a more reliable identification definition for test objects that are otherwise difficult to differentiate, and to ensure that the identification remains reliable even if the user interface design changes.
The Visual Relation Identifier Dialog Box provides the interface and tools to help to create and verify the visual relation identifier definitions.
Ø Collaborate with Developers to Pinpoint Defects Using Log Tracking
QuickTest's new Log Tracking functionality helps to work with developers to pinpoint the root causes of unexpected behavior of the application during run time.
When we enable log tracking, QuickTest receives the Java or .NET log framework messages from the application and embeds the same with the test run results.
We can click a log message in the results to jump to the relevant step in the run results tree, or we can click a step in the run results tree and view the log message that was generated at the time that the selected step ran. we can also specify that a log message of a particular level (or higher) will caused the test execution.
After you view the results, we can also print or export the log tracking details to a file to show to a developer, or we can provide the developer with the standalone Run Results Viewer installation so that the developer can view and analyze the results directly in their system.
Ø Out-of-the-Box Support for Web 2.0 Toolkit Applications
Now QTP 11.00 provides Web Add-in Extensibility-based add-ins for ASP .NET Ajax, GWT, Yahoo UI, and Dojo Web 2.0 toolkits.
We can use these add-ins just as the regular other add-in. we can also use Web Add-in Extensibility or Extensibility Accelerator to customize the provided support to match our needs.
We can install this add-ins by running the Web 2.0 Toolkit Support Setup from the Add-in Extensibility and Web 2.0 Toolkits option in the QuickTest Professional setup window.
Ø New Web Testing Capabilities
Many new testing capabilities are now available for working with Web-Based applications.
Firefox Testing: We can now record steps on Mozilla Firefox and use the .Object property to access the Firefox DOM.
XPath, CSS, Identifiers: We can add the XPath or CSS identifier properties to instruct QuickTest to identify a Web object in your application based on its XPath location or CSS definition.
Event Identifiers. You can also now use the attribute/* notation in the test object description to identify a Web-based object based on an event associated with that object. For example, we can add attribute/onClick as a property in a WebButton test object description to identify a button that is associated with the onClick event.
Embed or Run JavaScripts in Your Web Pages. You can use the new EmbedScript/EmbedScriptFromFile and RunScript/RunScriptFromFile functions to embed JavaScripts in all loaded browser pages and frames or to run JavaScripts in specific pages. Use these scripts to perform operations on, or retrieve data from, the browser pages in your application.
Ø Automatically Parameterize Steps

We can instruct QuickTest to automatically parameterize the steps in our test's actions at the end of a recording session.
This enables us to create actions that can be used for a variety of different purposes or scenarios by referencing different sets of data.

You activate this option by selecting the automatically parameterize steps option in the General tab of the Options dialog box. You can set the option to use Global Data Table Parameters or Test Parameters.


When we stop a recording session while this option is selected, QuickTest replaces the constant values in the test object operation arguments of your steps with either Data Table parameters or action parameters, based on your selection in the Options dialog box.


QuickTest performs this automatic parameterization for all relevant steps in any action in your test, in which you recorded one or more steps during that recording session.


If we work with HP ALM, and we can select the Global Data Table Parameters option, we can map the generated parameters to the column names of a data resource and then use different configurations in your test sets.


If we are working with SAP eCATT and when we select the Test Parameters option, then supply the values for the test parameters from eCATT.


Ø New Silverlight Add-in
You can use the new Silverlight Add-in to test objects in Silverlight 2 and Silverlight 3 applications.

After you install the Silverlight Add-in, it is displayed in the Add-in Manager as a child add-in under the WPF Add-in.
Ø Extend WPF and Silverlight Support

The WPF and Silverlight Add-in Extensibility SDK enables you to develop support for testing third-party and custom WPF and Silverlight controls that are not supported out-of-the-box by the relevant QuickTest add-ins.
You install the WPF and Silverlight Add-in Extensibility SDK from the Add-in Extensibility and Web 2.0 Toolkits option in the QuickTest Professional setup window.
Ø Use Extensibility Accelerator for Web Add-in Extensibility Development

The new Extensibility Accelerator for Functional Testing is a Visual Studio-like IDE that facilitates the design, development, and deployment of Web Add-in Extensibility support.

It provides a user interface and special tools that help you define new test object classes, map those test object classes to the controls in your application, and teach QuickTest how to identify the controls, perform operations on the controls and retrieve their properties.

You install the Extensibility Accelerator from the Add-in Extensibility and Web 2.0 Toolkits option in the QuickTest Professional setup window.
Ø It's Easier Than Ever to Insert Regular Expressions

The Smart Regular Expression list provides syntax hints that make it easier than ever to insert regular expressions into your test steps. It also enables you to access the Regular Expression Evaluator, which lets you test regular expressions to make sure they suit your needs.

Ø Load Function Libraries at Run Time

The new LoadFunctionLibrary statement lets you load a function library when a step runs instead of at the beginning of a run session. This means, for example, that you can define conditional steps that use functions from various function libraries, but load only the required function libraries during a run session.

Ø Avoid Downtime Due to License Server Failures

With redundant license servers we can create failover, so that if our main license server fails, other remaining servers maintain availability of your licenses without causing any downtime or loss of licenses for users.
The redundant license server feature is especially useful for enterprise customers who have a large network installation and want to maintain license server backup.
****Reference: HP QTP 11.00 Help
Follow Me on Twitter

QTP Patches for Windows 7

QTP Supports Windows 7 Operating System and 64 Bit Applications ?

QTP 11.00 Supports Microsoft Windows 7 OS and Windows Server 2008, you need to install the below Patches to get the complete support for the 64-bit applications.

"QuickTest Professional version 11.0 supports test particular techonologies on 64-bit applications after installing patch QTP_00699"

Download QTPWEB_00037 Patch

Download QTP_00644 Patch

Download QTP_00699 Patch


Note: Please review all instructions HP support terms and conditions before installing any of the patches.

Thursday, January 13, 2011

Download Quality Center 11.00

Download the latest version of QC 11 evaluation version from the hp site below.

Download Quality Center 11.00

Steps:
1. Open the above link
2. Click on the "HP Quality Center 11.00 Evaluation"
3. Login/Register to HP with valid information.
4. Click on I agree button to accept the terms of use
5. Now you will be able to see list of download links
6. Download this
I.Software_HP_ALM_11.00_Windows_TC096_15000.zip
II.Software_HP_ALM_11.00_Windows_TC096_15000.z01 files to one folder and extract it.
7. You have the setup to install the Quality Center 11 trail version :)
Let me know if you want more information...