Search This Blog

Wednesday, August 18, 2010

How to Generate Excel Reports in QC 10.0

To Create Excel reports -We need to have access for DashBoard module in QC 10.0
For QC 9.2 the reports option is under Tools - Home Page
and For QC 9.0 there is no option to generate Excel Reports

Navigation - QC 10.0 -
1) Go to DashBoard module
2) Select Excel Report in top left corner
3) Enter Report Name
4) Write Query under Query Tab
5) Add macro under Post Processing Script
6) Set the Status to "Ready"
7) For test purpose we can use Query Generator
8) For viewing of Tables we can use Query Generator
9) Click Generate Query
10)There you go report

Tuesday, August 17, 2010

Advantages and Disadvantages of Dictionary Objects

Dictionary Object

Dictionary Object stores data key, item pairs. A Dictionary object stores the items in the array. Each item is associated with a unique key. The key is used to retrieve an individual item and is usually an integer or a string, but can be anything except an array.



Adavntages of using it in QTP:

1. can be used as Global variable declaration. so that any test can access the values from it in the run time.

2. You can store and retrive any number of run time values in to dictonary.

3. It is one of the Parameterization techique we can use in QTP



Disadvantages:

we can not specify the values in the desingn time like Datatable , Action parameters, environment variable.

So it is useful only in Run time , not design time

What is Dictionary Object - Overview

Dictionary object allows storing key value pairs. A dictionary object can be used for easy lookup of values. Dictionary is a not a QTP specific functionality and is available in normal VBScript as well.

Creating the Dictionary
A dictionary object can be created using CreateObject for COM class “Scripting.Dictionary”. The code below shows how to create the dictionary object in QTP


'Create the Dictionary Object
Set oDict = CreateObject("Scripting.Dictionary")


Below table shows list of methods that dictionary objects supports.
Method Description
Add (key, item)- Adds a key and item pair to a Dictionary object.
Exists(key)- Returns true if a specified key exists in the Dictionary object, false if it does not
Items() - Returns an array containing all the items in a Dictionary object
Keys() - Returns an array containing all existing keys in a Dictionary object.
Remove(key) - Removes a key, item pair from a Dictionary object
RemoveAll() - The RemoveAll method removes all key, item pairs from a Dictionary object.

Count - Returns the number of items in a Dictionary object. Read-only.
Item Sets or returns an item for a specified key in a Dictionary object. Read/write
Key(Key) Sets a key in a Dictionary object.

Adding Items to Dictionary:
There are two ways to Add items to dictionary. One is to use the Add method and another is to use the Item property. Both the methods are shown in code below
'Method 1 for Adding items to dictionary
'Add items to dictionary
oDict.Add "CA", "California"
oDict.Add "LA", "Los Angeles"

'The below line will throw an error as LA key already exist
oDict.Add "LA", "Los Angeles 2"

'Method 2 for adding items to dictionary
oDict.Item("CA") = "California"

'Item is the default property so ".Item" is not required
oDict("LA") = "Los Angeles"

'No Error this time as we are actually using the
'Item property and not the Add method
oDict("LA") = "Los Angeles 2"100 Miles From Memphis

Monday, August 16, 2010

Checklist for web services

Design Considerations

Design chunky interfaces to reduce round trips.

Prefer message-based programming over remote procedure call (RPC) style.

Use literal message encoding for parameter formatting.

Prefer primitive types for Web service parameters.

Avoid maintaining server state between calls.

Consider input validation for costly Web methods.

Consider your approach to caching.

Consider approaches for bulk data transfer and attachments.

Avoid calling local Web Services.
Connections
**********************************************************

Configure the maxconnection attribute.

Prioritize and allocate connections across discrete Web services.

Use a single identity for outbound calls.

Consider UnsafeAuthenticatedConnectionSharing with Windows Integrated Authentication.

Use PreAuthenticate with Basic authentication.
Threading
********************************************************************

Tune the thread pool using the formula for reducing contention.

Consider minIoThreads and minWorkerThreads for intermittent burst load.
One Way (Fire and Forget) Communication
**********************************************************************

Consider using the OneWay attribute if you do not require a response.
Asynchronous Web Methods
*********************************************************************

Use asynchronous Web methods for I/O operations.

Do not use asynchronous Web methods when you depend on worker threads.
Asynchronous Invocation
*********************************************************************

Consider calling Web services asynchronously when you have additional parallel work.

Use asynchronous invocation to call multiple unrelated Web services.

Call Web services asynchronously for UI responsiveness.
Timeouts
*********************************************************************

Set your proxy timeout appropriately.

Set your ASP.NET timeout greater than your Web service timeout.

Abort connections for ASP.NET pages that timeout before a Web services call completes.

Consider the responseDeadlockInterval attribute.
WebMethods
*********************************************************************

Prefer primitive parameter types.

Consider buffering.

Consider caching responses.

Enable session state only for Web methods that need it.
Serialization
*********************************************************************

Reduce serialization with XmlIgnore.

Reduce round trips.

Consider XML compression.
Caching
*********************************************************************

Consider output caching for less volatile data.

Consider providing cache-related information to clients.

Consider perimeter caching.
State Management
*********************************************************************

Use session state only where it is needed.

Avoid server affinity.
Attachments
*********************************************************************

Prefer Base64 encoding. Direct Internet Message Encapsulation (DIME) is a supported part of Web Services Enhancements (WSE), but Microsoft® is not investing in this approach long-term. DIME is limited because the attachments are outside the SOAP envelope.
COM Interop
*********************************************************************

Avoid single-threaded apartment (STA) COM objects.