Tuesday, May 19, 2009

Batch Execution of QTP Scripts

Batch Execution of QTP Scripts

By Navneesh Garg

The user has several scripts which test different parts of his application, and he would like to execute the tests all together in a batch mode i.e. a main script that calls other scripts. The end objective is that complete suite of scripts can be executed without any human intervention one after another.

Here are some ways to run a set of several scripts together.
1. Use the Automation Object Model (AOM)
Use the Automation Object Model (AOM) to define the tests to be run and execute them. Using AOM you can set various QuickTest Professional settings and values. The AOM is as close as command line functionality as QuickTest Professional has. Using AOM you can get reference to QTP application object and using this reference, you can call and execute all QTP testscripts which you would want to run in sequence/batch mode. Inoder to find how to use AOM, you can refer to Object Model reference guide of QTP

2. Use TestDirector for Quality Center
Use TestDirector for Quality Center (Quality Center) to schedule and run an execution flow. Quality Center will launch QuickTest Professional and run the tests for you, so you will not need to launch QuickTest Professional, run a script, and close the script, in order to launch the next script.

3. Use Resuable Actions
Make the Actions in the test scripts reusable, then insert a copy or a call to action into the main test. This will call the Action of the scripts.

4. Use the Multi-Test Manager utility.

This utility is available on Mercury Support Site, which helps in batch execution of scripts. It has some decent features like, drag and drop of scripts, scheduling script execution and automatic emailing.

5. Use the Test Batch Runner utility.

You can access it by going to Start -> Programs -> QuickTest Professional -> Tools -> Test Batcher. For more information on the Test Batch Runner, please refer to the QuickTest Professional User’s Guide (QuickTest Professional User’s Guide -> Running and Debugging Tests and Components -> Running Tests and Components -> Running a Test Batch).


http://www.qacampus.com
http://www.crestech.in
http://www.crestechsoftware.com.au

SOA Testing Simplified (Series-I)

SOA Testing Simplified (Series-I)

By Pallavi Sharma

If you have reached this blog, then may be you have heard about SOA and testing SOA applications, or may be you understand testing and would like to know what SOA testing is all about or maybe you want to know what SOA and testing is all about… Well however complicated your case may be… I would explain SOA and testing SOA applications in an uncomplicated way to you in a series of blogs and this is the very first blog on it.

SOA stands for Service Oriented Architecture. It describes IT infrastructure which allows different applications to exchange data with one another as they participate in business processes. The aim is a loose coupling of services with operating systems, programming languages and other technologies which underlie applications. [1].

These services inter-operate based on a formal definition (or contract, e.g., WSDL) that is independent of the underlying platform and programming language. Services written in C# running on .NET platforms and services written in Java running on Java EE platforms, for example, can both be consumed by a common composite application (or client). Applications running on either platform can also consume services running on the other as Web services, which facilitates reuse.

Let’s understand the term ‘Web Service’. A Web Service in simplistic terms is a web enabled API, that can be accessed over the network. In the SOA architecture it is one component which takes care of a specified business need. Each web service has its own contract file which is required to communicate with it. This contract file is termed as WSDL, which is defined as, ‘Web Service Description Language’. As clear from the name, it provides information about what a web service is all about. The kinds of information you can fetch from the WSDL file are:
1. Where the web service is hosted.
2. What functionality the web service provides.
3. What all methods a web service consist of.
4. What arguments the web service takes and what response it returns.
Let’s take an example web service and its wsdl file and try to make sense out of it. The example web service is ‘MoneyConverter’; this service converts a currency value provided in Indian Rupees, to Dollars and vice versa. It solves a business requirement and will consist of two methods, you guessed them right:

a. RupeesToDollars
b. DollarsToRupees

Let’s take a look at the WSDL file for this service, which is an xml file describing this web service. [File attached]

To decipher the WSDL document, let’s begin from the end. The last xml node of the wsdl file provides information where the service is hosted.


A web service for converting currencies




Moving up, we find information about what all methods are present and what arguments they take and the return value.

wsdl:portType name=”ConverterSoap”>

Convert from Rupees to Dollars




Convert from Dollars to Rupees





Now we would like to know what does the input message looks like, and the output, for this lets move a bit up the document. The “wsdl type” xml node defines all the data types which are passed as arguments or returned as response after the method invocation. Let’s take one node and explain it further:








It states that the element is of type ‘decimal’, name of the element is ‘amount’, and it is a mandatory argument for the method, which can be understood by the minoccurs and maxoccurs attributes of the s:element node.

So, from the above information provided by the WSDL document of the MoneyConverter, we now know the following;

1. The port where the web service is hosted.
2. The methods which are present in the web service.
3. The arguments and the return value of each method of the web service.

Empowered with all this information, in the next blog series we will understand how we exactly use this web service, so that we are more enlightened to test it.
References:

1. Newcomer, Eric; Lomow, Greg (2005). Understanding SOA with Web Services. Addison Wesley. ISBN 0-321-18086-0.

(Copyrighted by CresTech Software Systems Pvt. Ltd.)


http://www.qacampus.com
http://www.crestech.in
http://www.crestechsoftware.com.au

What’s in Web 2.0

What’s in Web 2.0

The rising popularity of user-driven online services, including MySpace, Wikipedia, and YouTube, has drawn attention to a group of technological developments known as Web 2.0. So, what all cosist of web2.0?
Read till end…

Blogs (short for Web logs) are online journals or diaries hosted on a Web site and often distributed to other sites or readers using RSS (see below).

Collective intelligence refers to any system that attempts to tap the expertise of a group rather than an individual to make decisions. Technologies that contribute to collective intelligence include collaborative publishing and common databases for sharing knowledge.

Mash-ups are aggregations of content from different online sources to create a new service. An example would be a program that pulls apartment listings from one site and displays them on a Google map to show where the apartments are located.

Peer-to-peer networking (sometimes called P2P) is a technique for efficiently sharing files (music, videos, or text) either over the Internet or within a closed set of users. Unlike the traditional method of storing a file on one machine—which can become a bottleneck if many people try to access it at once—P2P distributes files across many machines, often those of the users themselves. Some systems retrieve files by gathering and assembling pieces of them from many machines.

Podcasts are audio or video recordings—a multimedia form of a blog or other content. They are often distributed through an aggregator, such as iTunes.

RSS (Really Simple Syndication) allows people to subscribe to online distributions of news, blogs, podcasts, or other information.

Social networking refers to systems that allow members of a specific site to learn about other members’ skills, talents, knowledge, or preferences. Commercial examples include Facebook and LinkedIn. Some companies use these systems internally to help identify experts.

Web services are software systems that make it easier for different systems to communicate with one another automatically in order to pass information or conduct transactions. For example, a retailer and supplier might use Web services to communicate over the Internet and automatically update each other’s inventory systems.

Wikis , such as Wikipedia, are systems for collaborative publishing. They allow many authors to contribute to an online document or discussion.



http://www.qacampus.com
http://www.crestech.in
http://www.crestechsoftware.com.au

Use Case Based Testing (UCBT)

Use Case Based Testing (UCBT)

Use Case Based Testing (UCBT), is a technique for generating test cases and recommended configurations for system level testing. In this approach, testers build a test model based on the standard UML notions of use cases, actors, and the relationships between these elements. The use cases are enhanced with additional information, including the inputs from actors, the outputs to the actors, and how the use case affects the state of the system. Newly developed algorithms use this model to generate a test suite which provides a specified level of coverage of each use case. We could also generate workload configurations that combine the test cases according to requirements specified in the model. The generation algorithm performs minimization to reduce the number of test cases required to cover the system to the specified level. The workload configurations are based on desired percentages associated with each actor that the tester provides. These features form a powerful basis for model-based test case generation.

What testing phase does UCBT address?
UCBT addresses phases where the tester is interested in exploring behavior that flows through multiple use cases, which are typically the late function, system, and solution phases of the test life cycle. In late function level test, the tester has tested the use cases individually, and is now interested in looking at combinations of the use cases. System test addresses the situation when all required functionality for the system is present, and the tester seeks to ensure the proper functioning of the system as a whole. An important component of system test is also ensuring that the system can handle customer-like scenarios and workloads. Solution test addresses the situation in which several complete systems are combined to provide complex functionality through some process that involves the systems. These processes can be captured, modeled, and tested using UCBT.

What does the tester do in UCBT?

To do UCBT, the tester needs to identify four things:
the use cases of interest,
the actors involved in using the system,
the input, output, and system effects for the use cases,
The flows of interest between the use cases.

A use case is a semantically meaningful function that provides some value from the user’s point of view. For example, saving a file in a word processing system would be represented by the Save File use case. Each use case can have input parameters associated with it, and for each parameter, a set of logical partitions of the values that parameter can take may be identified. Finally, the use cases can be connected using flows that describe a sequence of use case that are performed to accomplish some goal.

What is produced by UCBT Tool?
UCBT produces two types of test cases. The first types are abstract test cases, which are not executable. These are suitable for incorporation in a test plan and are provided in structured English. They show the ordering of use cases to be performed and the inputs and expected results that each use case should have during the test. The second type of test cases are in a format known as ATS, which can be used to create executable test cases using another tool known as TCBeans or any such tool . The test suite produced by UCBT is minimized in size by performing a two pass optimization based upon the input parameter interactions that the tester specifies, as well as the flows of interest. This ensures that the number of test cases is reasonable, so execution and evaluation can be done with a feasible amount of effort.



http://www.qacampus.com
http://www.crestech.in
http://www.crestechsoftware.com.au

What’s new with QTP9.5

What’s new with QTP9.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 the order in which the “main” actions are called, as well as the inner-action calls between actions. Other than understanding the test flow, it offers a central place to access and maintain the properties of the actions. One can easily delete an action, change its properties and its action-call properties, access its object- repository, and control the order in which it will be called within a test.

Resource Pane:
This pane offers a quick overview of all the external function files, recovery scenarios and object repositories associated with the test; it also provides a quick way to add and remove these resources. One can associate repositories with specific actions, add new external library files and add new recovery scenarios.

Process Guidance Pane:
This pane (or rather – panes) somewhat resembles MS Office on-line help. These panes include a topic list on one side and a content area on the other (though you can position and dock the components as you like). Clicking a topic will load its contents onto the content area, and one can navigate via the Next and Back buttons.
One can add his own “process guidance packages”, which can offer unique topics and contents. For example, these might include the way to store tests and manage code versions, how to work with custom objects in the application, coding standards, and much more. These packages can be easily created with simple HTML pages and a contents XML file.

2. Checkpoint and Output Values Management
Checkpoint and Output Objects in the Object Repository: All your checkpoints and output values are stored as objects in the object repository so that you can manage them together with your test objects.
Enhanced functionality of Bitmap Checkpoint: Bitmap checkpoints now include options for specifying RGB tolerance (percentage) and pixel tolerance (number of pixels or percentage) values. These values enable one to indicate acceptable differences between the actual image and the one stored with the checkpoint.

3. Running Scripts in Maintenance Mode
In Maintenance Run Mode, QTP identifies discrepancies between the objects in the repository and those in application, and then offers solutions for updating objects and steps in real time. The run pauses each time an object is not found. One can point to the required object in application, and QuickTest will recommend a solution for updating the object repository and test step to match the selected object. Alternatively, one can select to add comments to a problematic step and address it manually at a later time.

4. Web Add-In Extensibility
QTP 9.5 enables one to extend the support given for Web objects by means of its Web Add-In Extensibility feature. This feature is very important especially when the AUT includes unsupported third-party or custom Web controls. Moreover new technologies such as AJAX are also supported. To use this feature, JavaScript knowledge is necessary. Implementing a Web extension requires to configure 2 XML files, write some code in JavaScript and then deploy these files to the required folders.

5. New Supported Operating Systems and Environments
QTP 9.5 has added new support for the operating systems, browsers, and development environments listed below.
• Windows Vista 64-bit Edition
• Netscape Browser 8.1.3, and 9
• Mozilla Firefox 2 and 3.0 Alpha 7
• Microsoft .NET Framework 3.5
• Oracle Forms and Oracle Applications, version 10g
• Java SWT toolkit, versions 3.2, and 3.3
• Eclipse IDE, version 3.2 and 3.3 (For Java Add-in Extensibility)
• New Terminal Emulator types and versions:
o AttachmateWRQ EXTRA! 9, Terminal Viewer (compatible EXTRA! 9), Reflection for Unix and OpenVMS sessions 14, Reflection 14
(Note: Reflection 13 is not supported.)
o Hummingbird HostExplorer 2007
(Note: HostExplorer 2006 is not supported)
o IBM IBM 5.9, IBM WebSphere Host On-Demand 10
o NetManage RUMBA 7.5, RUMBA Web-to-Host 5.3
o Seagull BlueZone 4
o Zephyr PASSPORT 2007, PASSPORT PC TO HOST / WEB TO HOST 2004 and 2007

6. Miscellaneous Improvements:
Auto-convert to relative path: Whenever you include a resource (e.g. an external library, object repository, etc.) a pop-up will appear, suggesting to add the relevant path to QTP’s folders list, and to convert that path to a relative one.
New actions are reusable: In QTP 9.5, when you create new actions, they are set as reusable by default.
Text recognition mechanism: One can now configure which text recognition mechanism(s) you want to use for recognizing text in Windows applications, and also in which order the mechanisms should be applied.
Record on SWT: When using the Java Add-in, recording on objects developed using the SWT toolkit is now supported.


http://www.qacampus.com
http://www.crestech.in
http://www.crestechsoftware.com.au

Database Handling in QTP using ADODB

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 selected. You will write the command as:
Db.ConnectionString = “DSN = MyDSN”

In case you don’t want to create a DSN-
Connection String will now contain the complete information of what is contained in DSN. It has a benefit over DSN, that the connection since it can contain the complete network path of the database, so can work on all systems. But in case of DSN, that has to be present in the machine when you are using it. Again taking that database is on MS-Access -
Db.ConnectionString = “Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;”

Opening the connection

Once the connection string has been set, next step goes towards the opening of the connection. It basically setup the connection/pathway with the database being specified in the connection string. Command goes like:
Db.Open

Firing of the query

Next step goes to the writing of the SQL Query and executing it. We write a sql query in a variable and that query is executed. On executing the query, a recordset object is returned which contains the result set of the query executed.
Getting the SQL Query:
SQL = “Select * from table1”

Executing the SQL query and capturing the recordset object returned:
Set rec_ob = Db.execute (SQL)

Accessing data with Record Set Object

As per the example, rec_ob is the recordset object containing the result of the query which was being executed. Now we can capture each record in the recordset. In general for looping down till end through the recordset we use the following:
Do while rec_ob.EOF <> true
Operation on records
Loop

Various important methods/events/properties and collection supported recordset object with explanation:
Properties:
BOF – Returns true if the current record position is before the first record,
otherwise false.
EOF - Returns true if the current record position is after the last record,
otherwise false
State – Returns a value that describes if the Recordset object is open, closed,
connecting, executing or retrieving data

Methods:
Open – Opens a Recordset
Close - Closes the Recordset
MoveFirst - Moves the record pointer to the first record
MoveLast - Moves the record pointer to the last record
MoveNext - Moves the record pointer to the next record
MovePrevious - Moves the record pointer to the previous record
Save - Saves a Recordset object to a file or a Stream Object

Events:
The various events supported by ADODB Recordset object cannot be handled using VBScript or JSCript (Only VB, V C++ and V J++ can handle these events). So we are not going discuss these over here.
Collections:
Fields - Indicates the number of field objects in the Recordset object
Properties - Contains all the Property objects in the Recordset object
The Fields Collection’s Properties:
Count - Returns the number of items in the fields collection. Starts at zero
Item (name/number) – Returns a specified item in the fields collection.

The Properties Collection’s Properties:
Count - Returns the number of items in the properties collection. Starts at
Zero
Item (name/number) – Returns a specified item in the properties collection.
Closing the connection

Once all the activities have been carried out on Recordset object and no more database accessing is record, you need to close the connection established by the ADODB object. Command goes like:
Db.Close

Releasing the memory space occupied by the Objects

The final work is to free up the space occupied by all the objects which were created to reference the objects created. This is done for freeing up the memory so that there is no memory leak.
Set Db = nothing


http://www.qacampus.com
http://www.crestech.in
http://www.crestechsoftware.com.au

Saturday, March 14, 2009

IBM Rational TestManager

IBM Rational TestManager



Rational® TestManager is the central console for test activity management, execution and reporting. Built for extensibility, it supports everything from pure manual test approaches to various automated paradigms including unit testing, functional regression testing, and performance testing. Rational TestManager is meant to be accessed by all members of a project team, ensuring the high visibility of test coverage information, defect trends, and application readiness. Rational TestManager is freely available to all users of IBM Rational® Functional Tester, Rational Manual Tester and IBM Rational® Robot. And because of its value to development teams, it is also included in the IBM Rational® Team Unifying Platform.

http://www.qacampus.com
http://www.crestech.in
http://www.crestechsoftware.com.au