Sunday, April 26, 2009

Get Size of Folder/File

Hi All,

Here iam providing a simple way of finding the size of required folder/file.
Try the below code & implement the same wherever & whenever applicable/required.

' Get the size of folder:
dim fso
foldername="Sreekanth"
Set fso = CreateObject( "Scripting.FileSystemObject" )
Set folder1 = fso.GetFolder( "D:\Documents and Settings\Sree\Desktop\"&foldername)
msgbox "Size of Folder "&foldername&" :- "&folder1.Size&" bytes"
Set fso=Nothing
' Output :











' Get the size of file:
Set fso = CreateObject( "Scripting.FileSystemObject" )
fname="qtpinf"
Set folder1 = fso.Getfile("D:\Documents and Settings\Sree\Desktop\"&fname&".doc")
msgbox "Size of File "&fname&" :- "&folder1.Size&" bytes"
Set fso=Nothing

' Output :






Saturday, April 18, 2009

QTP 10.0 Window - Key Elements

Hi All,
Here i am giving an overview of key elements of the QuickTest Window .
The QuickTest window displays your testing documents in the document area.
You can work on one test and one or more function libraries simultaneously. (For your convenience, you can display one active document in the document area, or you can cascade or tile your open documents.)

The document area of the QuickTest window can display the following:

Test:
Enables you to create, view, and modify your test in Keyword View or Expert View.
Function Library:
Enables you to create, view, and modify functions (operations) for use with your test.
Start Page:
Welcomes you to QuickTest and provides links to Process Guidance. You can use the shortcut buttons to open new and existing documents.
Key Elements in the QuickTest Window :
In addition to the document area, the QuickTest window contains the following key elements:

QuickTest title bar:
Displays the name of the active document. If changes have been made since it was last saved, an asterisk (*) is displayed next to the document name in the title bar.

Menu bar:
Displays menus of QuickTest commands.

Standard toolbar:
Contains buttons to assist you in managing your document.

Automation toolbar:
Contains buttons to assist you in the testing process.

Debug toolbar:
Contains buttons to assist you in debugging your document. (Not displayed by default)
Edit toolbar:
Contains buttons to assist you in editing your test or function library.

Insert toolbar:
Contains buttons to assist you when working with steps and statements in your test or function library.

Tools toolbar:
Contains buttons with tools to assist you in the testing process.

View toolbar:
Contains buttons to assist you in viewing your document.

Action toolbar:
Contains buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow. (Not displayed by default)

Document tabs and scroll arrows:
Enables you to navigate open documents in the document area by selecting the tab of the document you want to activate (bring into focus). When there is not enough space in the document area to display all of the tabs simultaneously, you can use the left and right arrows to scroll between your open documents.

Keyword View:
Contains each step, and displays the object hierarchy, in a modular, icon-based table.

Expert View:
Contains each step as a VBScript line. In object-based steps, the VBScript line defines the object hierarchy.
Status bar: Displays the status of the QuickTest application and other relevant information.

You can show or hide the following panes from the View menu:
Active Screen:
Provides a snapshot of your application as it appeared when you performed a certain step during the recording session.
Data Table:
Assists you in parameterizing your test. The Data Table contains the Global tab and a tab for each action.
Debug Viewer pane:
Assists you in debugging your document. The Debug Viewer pane contains the Watch, Variables, and Command tabs.
Information pane:
Displays a list of syntax errors found in your test and function library scripts.
Missing Resources pane:
Provides a list of the resources that are specified in your test but cannot be found, such as missing calls to actions, unmapped shared object repositories, and parameters that are connected to shared object repositories. The Missing Resources pane then enables you to locate or remove them from your test.
Process Guidance panes:
Displays two panes that provide procedures and descriptions on how to best perform specific processes, such as creating a test in QuickTest. The Process Guidance Activities pane lists the activities that you can perform, such as adding steps to a test. The Process Guidance Description pane describes the tasks that you need to perform for a selected activity. Your organization may also provide you with process guidance that is accessible from these panes.
Available Keywords Pane:
Displays all the keywords available to your test. Enables you to drag and drop objects or calls to functions into your test.
Test Flow Pane:
Displays the hierarchy of actions and action calls in the current test, and shows the order in which they are run.
Resources Pane:
Displays all the resources associated with your current test and enables you to manage these resources.
You can customize the layout of the QuickTest window by moving, resizing, displaying, or hiding most of the elements. QuickTest remembers your preferred layout settings and opens subsequent sessions with your customized layout
Given below is the view of QTP 10.0 window:



Parameterization & Types of Parameters in QTP

Hi All,
I hope while learning/working on QTP you might have heard about the term "Parameterization".

"Parameterization" : Its a process of passing multiple values(test data/Input Data) for a constant value(Hard Coded) inorder to retest certain functionality/feature.

Data Driven Testing(Retesting) can be done using the Parameterization.

There are 4 types of parameters:
1) Test/action parameters
2) Data Table parameters
3) Environment variable parameters
4) Random number parameters


Test/action parameters :
Test parameters enable you to use values passed from your test. Action parameters enable you to pass values from other actions in your test.
To use a value within a specific action, you must pass the value down through the action hierarchy of your test to the required action. You can then use that parameter value to parameterize a step in your test. For example, suppose that Action3 is a nested action of Action1 (a top-level action), and you want to parameterize a step in Action3 using a value that is passed into your test from the external application that runs (calls) the test. You can pass the value from the test level to Action1, then to Action3, and then parameterize the required step using this action input parameter value (that was passed through from the external application).
Alternatively, you can pass an output action parameter value from an action step to a later sibling action at the same hierarchical level. For example, suppose that Action2, Action3, and Action4 are sibling actions at the same hierarchical level, and that these are all nested actions of Action1. You can parameterize a call to Action4 based on an output value retrieved from Action2 or Action3. You can then use these parameters in your action step.


Data Table parameters :
Enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, QuickTest uses a different value from the Data Table.
For example, suppose your application includes a feature that enables users to search for contact information from a membership database. When the user enters a member's name, the member's contact information is displayed, together with a button labelled View 's Picture, where is the name of the member. You can parameterize the name property of the button using a list of values so that during each iteration of the run session, QuickTest can identify the different picture buttons.


Environment variable parameters:
Enable you to use variable values from other sources during the run session. These may be values you supply, or values that QuickTest generates for you based on conditions and options you choose.
For example, you can have QuickTest read all the values for filling in a Web form from an external file, or you can use one of QuickTest's built-in environment variables to insert current information about the computer running the test.

Random number parameters:
Enable you to insert random numbers as values in your test. For example, to check how your application handles small and large ticket orders, you can have QuickTest generate a random number and insert it in a number of tickets edit box.