You are on page 1of 172

Tuesday, April 19, 2011

using Childnodes

For the given XML File to read data below is the code
Set xm=CreateObject("Microsoft.XMLDOM")
xm.load "e:\xmlf\book.xml"
Set c1=xm.documentElement.childNodes
For i=0 to c1.length-1
msgbox c1.item(i).nodeName
set c2=c1.item(i).childNodes
for j=0 to c2.length-1
msgbox c2.item(j).text
next
Next
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:29 AM 0
comments
Monday, April 18, 2011
manipulate XML File using Microsoft.XMLDOM
Example :Existing xml file "book.xml"
==========================

==========================

'''''Create new elements in XML File


dim xm
set xm=CreateObject("Microsoft.XMLDOM")
xm.load "e:\book.xml"
for i=1 to 3
s=inputbox("Enter the book title")
set newele=xm.CreateElement("Title")
set newtxt=xm.CreateTextNode(s)
newele.appendChild(newtxt)
set e=xm.DocumentElement
e.appendChild(newele)
set e=e.lastChild
Next
xm.save "e:\book.xml"
=============================================
''''''''''''Read data from xml file
dim xm
set xm=CreateObject("Microsoft.XMLDOM")
xm.load "e:\book.xml"
set x=xm.getelementsbytagname("Title")
For i=0 to x.length-1
set c=x(i).childnodes(0)
msgbox c.nodevalue
Next
=============================================
'''''''Read data from existing file and update with new values
Dim xm
Set xm=CreateObject("Microsoft.XMLDOM")
xm.load "e:\book.xml"
set x=xm.getelementsbytagname("Title")
For i=0 to x.length-1
set c=x(i).childnodes(0)
t=inputbox("Enter title")
c.nodevalue=t
Next

xm.save "e:\book.xml"
===========================================
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 1:15 AM 0
comments
Microsoft.XMLDOM

Below are the methods used to access and manipulate XML documents via the XML DOM
implementation

Reference : http://msdn.microsoft.com/en-us/library/ms757828(v=vs.85).aspx

Method

Description

abort (DOMDocument)

Aborts an asynchronous download in


progress.

abort (IXMLHTTPRequest)

Cancels the current HTTP request.

abort (ServerXMLHTTP/IServerXMLHTTPRequest)

Cancels the current HTTP request.

add

Adds a new schema to the schema


collection and associates the given
namespace URI with the specified schema.

addCollection

Adds schemas from another collection into


the current collection and replaces any
schemas that collide on the same
namespace URI.

addObject

Adds objects to a style sheet.

addParameter

Adds parameters to a style sheet.

appendChild

Appends a new child node as the last child

of the node.
appendData

Appends the supplied string to the existing


string data.

clone

Clones a copy of the current


IXMLDOMSelection, with the same position
and context.

cloneNode

Clones a new node.

createAttribute

Creates a new attribute with the specified


name.

createCDATASection

Creates a CDATA section node that


contains the supplied data.

createComment

Creates a comment node that contains the


supplied data.

createDocumentFragment

Creates an empty
IXMLDOMDocumentFragment object.

createElement

Creates an element node using the


specified name.

createEntityReference

Creates a new EntityReference object.

createNode

Creates a node using the supplied type,


name, and namespace.

createProcessingInstruction

Creates a processing instruction node that


contains the supplied target and data.

createProcessor

Creates a rental-model IXSLProcessor


object that will use this template.

createTextNode

Creates a text node that contains the


supplied data.

errorParameters

Returns the parameter value for a given


index.

deleteData

Deletes specified data.

DllSetProperty

Sets a global property for the DLL.

get

Returns a read-only XML Document Object


Model (DOM) node that contains the
element.

getAllResponseHeaders (IXMLHTTPRequest)

Retrieves the values of all the HTTP


headers.

getAllResponseHeaders
(ServerXMLHTTP/IServerXMLHTTPRequest)

Retrieves the values of all the HTTP


headers.

getAttribute

Gets the value of the attribute.

getAttributeNode

Gets the attribute node.

getDeclaration

Returns the declaration of the DOM node


that is sent to the function.

getElementsByTagName (DOMDocument)

Returns a collection of elements that have


the specified name.

getElementsByTagName (IXMLDOMElement)

Returns a list of all descendant elements


that match the supplied name.

getNamedItem

Retrieves the attribute with the specified


name.

getOption

Returns the value of the specified option.

getProperty (IXMLDOMDocument2)

Returns the default properties.

getProperty (IXMLDOMSelection)

Returns a property.

getQualifiedItem Method

Returns the attribute with the specified


namespace and attribute name.

getResponseHeader (IXMLHTTPRequest)

Retrieves the value of an HTTP header from


the response body.

getResponseHeader
(ServerXMLHTTP/IServerXMLHTTPRequest)

Retrieves the value of an HTTP header from


the response body.

getSchema Method

Returns an ISchema object.

hasChildNodes

Provides a fast way to determine whether a


node has children.

hasFeature

Indicates support for the specified feature.

importNode

Clones a node from a different DOM object.

insertBefore

Inserts a child node to the left of the


specified node or at the end of the list.

insertData

Inserts a string at the specified offset.

item (IXMLDOMNodeList)

Allows random access to individual nodes


within the collection.

item (IXMLDOMNamedNodeMap)

Allows random access to individual nodes


within the collection.

load

Loads an XML document from the specified


location.

loadXML

Loads an XML document using the supplied


string.

matches

Checks if the node that is passed is


contained in the current collection.

nextNode (IXMLDOMNodeList)

Returns the next node in the collection.

nextNode (IXMLDOMNamedNodeMap)

Returns the next node in the collection.

nodeFromID

Returns the node that matches the ID


attribute.

normalize

Normalizes all descendant elements by


combining two or more adjacent text nodes
into one unified text node.

open (IXMLHTTPRequest)

Initializes an MSXML2.XMLHTTP request


and specifies the method, URL, and
authentication information for the request.

open (ServerXMLHTTP/IServerXMLHTTPRequest)

Initializes a request and specifies the


method, URL, and authentication
information for the request.

peekNode

Gets the next node that the nextNode


method will return without advancing the
list position.

remove

Removes the specified namespace from a


collection.

removeAll

Removes all the nodes from the collection


described by the IXMLDOMSelection.

removeAttribute

Removes or replaces the named attribute.

removeAttributeNode

Removes the specified attribute from this


element.

removeChild

Removes the specified child node from the


list of children and returns it.

removeNamedItem

Removes an attribute from the collection.

removeNext

Removes the next node.

removeQualifiedItem

Removes the attribute with the specified


namespace and attribute name.

replaceChild

Replaces the specified old child node with


the supplied new child node.

replaceData

Replaces the specified number of


characters with the supplied string.

reset (IXMLDOMNamedNodeMap)

Resets the iterator.

reset (IXMLDOMNodeList)

Resets the iterator.

reset (IXMLDOMParseErrorCollection)

Resets the internal position to start, so that


the next method will return the first error
in the list.

reset (IXSLProcessor)

Resets the state of the processor to the


state it was in prior to calling the transform
method.

save

Saves an XML document to the specified


location.

selectNodes

Applies the specified pattern-matching


operation to this node's context and
returns the list of matching nodes as
IXMLDOMNodeList.

selectSingleNode

Applies the specified pattern-matching


operation to this node's context and
returns the first matching node.

send (IXMLHTTPRequest)

Sends an HTTP request to the server and


receives a response.

send (ServerXMLHTTP/IServerXMLHTTPRequest)

Sends an HTTP request to the server and


receives a response.

setAttribute

Sets the value of the named attribute.

setAttributeNode

Sets or updates the supplied attribute node


on this element.

setNamedItem

Adds the supplied node to the collection.

setOption

Sets the specified option.

setProperty

Sets the SelectionLanguage,


ServerHTTPRequest, SelectionNamespaces
or NewParser internal properties (flags).

setProxy

Sets the proxy configuration.

setProxyCredentials

Sets the proxy authentication credentials.

setRequestHeader (IXMLHTTPRequest)

Specifies the name of an HTTP header.

setRequestHeader
(ServerXMLHTTP/IServerXMLHTTPRequest)

Specifies the name of an HTTP header.

setStartMode

Performs a subset of a larger XSLT


transformation by selecting the XSLT mode
with which to start.

setTimeouts

Specifies timeout settings for resolving the


domain name, establishing the connection
to the server, sending the data, and
receiving the response.

splitText

Splits this text node into two text nodes at


the specified offset and inserts the new
text node into the tree as a sibling that
immediately follows this node.

substringData

Retrieves a substring of the full string from


the specified range.

transform

Starts the transformation process or


resumes a previously failed transformation.

transformNode

Processes this node and its children using


the supplied XSL Transformations (XSLT)
style sheet and returns the resulting
transformation.

transformNodeToObject

Processes this node and its children using


the supplied XSLT style sheet, and returns
the resulting transformation in the supplied
object.

validate

Performs run-time validation on the


currently loaded document using the
currently loaded DTD, schema, or schema
collection.

validate
Performs run-time validation on the
(IXMLDOMSchemaCollection2/XMLDOMSchemaCollection documents in the schema cache that have
not been compiled and validated.
validateNode

Validates a specified DOM fragment.

waitForResponse

Allows the requesting server to suspend


execution while waiting for an
asynchronous send operation to complete.

Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 12:48 AM

Wednesday, April 13, 2011


Registeruserfunc

Register user function to TestObject

TestObjects are the objects in the Repository and these Objects are used in the Test ( Script),,, see any
object in the repository are under TestObject Structure

Learn the step by step procedure how to Register user created function to any test object and when
writing the Script our Created function is also displayed in the Intellisence

1. Open Notepad
2. Write the Required Function
3. Write statement to Register the userfunction to the required testobject
4. Save the file as Filename.vbs
=========================
For the above 4 steps in notepad (sample function fn_sample is Defined and registered as below)

In Notepad
public Function fn_sample
msgbox "Hello"
End Function

Registeruserfunc "WinButton","myfunc","fn_sample"

Save it as function libary ( filename.vbs)

In the above code fn_sample is registered for WinButton and in the script in Intellisence "myfunc" is
displayed
===========================

5. After saving the file,,, associate the library to the QTP Test
File menu---Settings---Resource----Associate function library (and select the above created library and
associate)

6. In the Test ( add any WinButton from application into Repository)


for example Add (OK,Cancel buttons in Flight application "Login" dialogbox)

7. Write script
Dialog("Login").winButton("OK").myfunc
Dialog("Login").WinButton("Cancel").myfunc
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 10:58 AM 0
comments
Tuesday, April 12, 2011
using Dotnetfactory Examples
''''Write Text into the file
Dim df
Set df=Dotnetfactory.CreateInstance("System.IO.File")
df.writealltext "d:\online\data.txt","this is sample"
'''Read text from the file
Dim df,s
Set df=Dotnetfactory.CreateInstance("System.IO.File")
s=df.readalltext("d:\online\data.txt")
msgbox s
'''Convert the date into req format

Dim df , d
Set df=Dotnetfactory.CreateInstance("System.DateTime")
Set d=df.Parse("Tue, 12 Apr 2011")
msgbox d.Day & "/" & d.Month & "/" & d.Year
Note : for more Classes, Methods Refer msdn.microsoft.com
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 3:53 AM 0
comments
Reg QTP 10 and Firefox 3.6 browser
Hi ,,
some of the students are trying to run the scripts on firefox browser and facing problems,,, Like working
with IE you cannot directly work with Firfox browser,,,, the below patch need to be downloaded and
installed in you system
and for complete list of environments supported by QTP is available in QTP Readme file.

Note: To enable QuickTest to run tests in Firefox 3.6 on a machine with UAC enabled, you need to start
QuickTest
once using "Run as administrator" after installing the patch and Firefox 3.6.
Additional information about this patch and the patch download are available at the HP Software
Support Online website:
http://h20230.www2.hp.com/selfsolve/document/FID/DOCUMENTUM_QTPWEB_00059

Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 3:38 AM 0


comments
using Instr Function
Count the number of times "is" repeated in the below string
s="This is sample"
p=1
cnt=0
while instr(p,s,"is")>0
cnt=cnt+1
p=instr(p,s,"is")+len("is")

wend
msgbox "Is repeated times are "&cnt
==================================
''''Another logic
s="This is sample"
a=split(s,"is")
msgbox "Is is repated for "&ubound(a)
====================================
'''Another Logic
s="This is sample"
cnt=0
For i=1 to len(s)
a=mid(s,i,2)
If a="is" Then
cnt=cnt+1
End If
Next
msgbox "is repeated for "&cnt

Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 3:29 AM 0


comments
Friday, December 24, 2010
Script to close all the browsers
1. ''Suppose there are 10 browser ;;; write script to close all the browsers ''The below script will close
all the open browser

dim d
set d=Description.Create
d("micclass").value="Browser"
set a=Desktop.ChildObjects(d)
for i=0 to a.count-1
a(i).close
Next

2. There are 10 browsers and in that 1 browser is mercury tours website.... except mercury tours
browser all the other browsers should be closed
'' Get all the browsers and for each browser get the title
'' in the title if "mercury" word is not there then close
dim d
set d=Description.Create
d("micclass").value="Browser"
set a=Desktop.ChildObjects(d)
for i=0 to a.count-1
s=a(i).getROProperty("title")
if instr(1,s,"Mercury")=0 Then
a(i).close
End if
Next
Publish Post

---------------------Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 1:21 AM 0


comments

Calling DLLs in QTP


DLL--Dynamic Link Library
It has basically programs, these can be called from any application, by creating instance for the dll /
reference to the DLL.
The DLLs can be developed in c,c++,java,.net...etc
Usually all the dlls related to Windows OS are available in C:\WINDOWS\system32 folder and we can
refer MSDN help to know the system DLLs and the functions available in these DLLs
User created dlls are also should be copied into this folder and should be registered before using.

To register usercreated dlls regsvr32 can be used.

To call the methods or properties in the DLL

1. using DotnetFactory
''below is the syntax to refer DLL and call the methods
Dim myobj
Set myobj=DOTNetFactory.CreateInstance("namespace.class", "path of the dll")
myobj.method ''to call the method
myobj.property '' to access the property

2. Using Extern Object

' The below script will check Notepadwindow is available or not


'Here we are using user32.dll

Extern.Declare micHwnd,"FindWindow","user32.dll","FindWindow", micString, micString


hwnd = Extern.FindWindow("Notepad", vbNullString)
if hwnd = 0 then
MsgBox "Notepad window not found"

else
MsgBox "Notepad window found"
end if
----------------------------Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 12:55 AM 0
comments
Wednesday, December 15, 2010
DotNetFactory Introduction---1
DotNetFactory
This utility object is available from QTP 9.2 onwards and all the versions after 9.2,
This utility object you can see in Insert menu--->Step Generator---->utility object Category---->Select in
Object List
This Object Provides QTP scripting to access methods and properties of a .NET object by creating an
instance for this object.
Syntax :
Dim d
set d=CreateInstance(Typename,assembly,parameters)
Typename : name of the object
assembly (optional): if it is already preloaded assembly then no need to specify else we have to specify
the assembly ie. the DLL which has the typename
parameters: specify the parameters if typename has any input parameters.
Note : Refer in msdn.microsoft.com for all the System Namespace and its classess, .Net Class Library
list,,, below is the link
http://msdn.microsoft.com/en-us/library/d11h6832(v=VS.71).aspx.....
Few Examples :
Example 1:
' Display our own message Created from System.Windows.Forms.MessageBox --Typename ,, which
belong to System.Windows.Forms Assembly

Dim msg
Set msg = DotNetFactory.CreateInstance("System.Windows.Forms.MessageBox",
"System.Windows.Forms")
msg.show "This is Venkat","Sample"
-------------------------------------------------Example :2
'Display our own window /Form
Dim frm1
Set frm1 = DotNetFactory.CreateInstance("System.Windows.Forms.Form", "System.Windows.Forms")
frm1.Text = "Venkat"
frm1.Maximizebox = True
frm1.Minimizebox = True
frm1.Width = 500
frm1.Height =200
frm1.Location.X = 50
frm1.Location.Y = 200
frm1.Show
--------------------------------------Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 4:51 PM

Tuesday, December 14, 2010


QC API and QTP AOM Scripts
Connect to QC and Add a New Defect
---------------------------------------------------Dim qccon
Set qccon=CreateObject("TDApiOle80.TDConnection")
qccon.InitConnectionEx "http://qcserverurl:8080/qcbin"
qccon.login "username","password"
qccon.Connect "DEFAULT","QualityCenter_Demo"
Set BugFactory = qccon.BugFactory
Set Bug = BugFactory.AddItem(Nothing)
Bug.Status = "New"
Bug.Summary = "Error in login"
Bug.Priority = "4-Very High"
Bug.AssignedTo ="user1"
Bug.DetectedBy = "venkat"
Bug.Post
-----------------------------------------------Connect to QC and Read all the Defects and Write in Excel
------------------------------------------------Dim qc,bgf,bglist,xl,ws,b,r
Set qc=CreateObject("TDApiOle80.TDConnection")
qc.InitConnectionEx "http://localhost:8080/qcbin"
qc.login "admin", "mindq"
qc.Connect "DEFAULT","QualityCenter_Demo"

Set bgf = qc.BugFactory


Set bglist = bgf.NewList("")

Set xl=CreateObject("Excel.Application")
xl.WorkBooks.Add()
Set ws=xl.ActiveSheet
r=1
For Each b In bglist
ws.Cells(r, 1).Value =b.Field("BG_BUG_ID")
ws.Cells(r, 2).Value = b.Summary
ws.Cells(r, 3).Value = b.DetectedBy

ws.Cells(r, 4).Value = b.Priority


ws.Cells(r, 5).Value = b.Status
ws.Cells(r, 6).Value = b.AssignedTo
r=r+1
Next
xl.ActiveWorkbook.SaveAs("C:\QC_Demo_defects.xls")
xl.Quit
===========================================
To open QTP Test and count the number of repositories associated
---------------------------------------------------------------Dim app
set app=CreateObject("QuickTest.Application")
app.launch
app.visible=True
app.open "c:\test1",False
set r=app.Test.Actions("Action1").ObjectRepositories
msgbox "Total ORs :"&r.count
for i=1 to r.count
msgbox "Path of OR :"&r.item(i)
next
app.quit
set r=nothing
set app=nothing
-----------------------------------------------------------------To count the recovery scenarios associated to the test
------------------------------------------------------------------dim app
set app=CreateObject("QuickTest.Application")
app.launch
app.open "c:\test1",false
app.visible=True
set rs=app.Test.settings.Recovery
if rs.count>0 then
redim a(rs.count)
for i=0 to rs.count
a(i)=rs.item(i+1).name
i=i+1
next
end if
print "The recovery scenarios associated to the test are"
for i=0 to ubound(a)
print a(i)

next
---------------------------------------------------------script to display the list of actions and their details
---------------------------------------------------------Dim app
set app=CreateObject("QuickTest.Application")
app.launch
app.visible=True
app.open "c:\test1"
redim a(app.Test.Actions.count)
for i=1 to app.Test.Actions.count
a(i-1)=app.Test.Actions.item(i).name&" "&app.Test.Actions.item(i).type&"
"&app.Test.Actions.item(i).location
next
for i=0 to ubount(a)
print a(i)
next
=========================================
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 11:06 PM

Friday, September 24, 2010


Class room excel script
Dim xl,wb,ws
Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Open("f:\data.xls")
Set ws=wb.Worksheets("Sheet1")
For i=2 to 5
e=ws.cells(i,6)
td=ws.cells(i,9)
a=split(td,",")
Systemutil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"
Dialog("Login").WinEdit("Agent Name:").Set a(0)
Dialog("Login").WinEdit("Password:").Set a(1)
Dialog("Login").WinButton("OK").Click
If window("Flight Reservation").Exist Then
f=1
window("Flight Reservation").Close
else
f=0
Dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click
Dialog("Login").Close
End If
If (f=1 and e="Login") or (f=0 and e="Error") Then
ws.cells(i,7)="Expected and actual are same"
ws.cells(i,8)="Passed"
ws.cells(i,8).interior.colorindex=4
else
ws.cells(i,7)="Expected and actual are not same"
ws.cells(i,8)="Failed"
ws.cells(i,8).interior.colorindex=3
End If
Next
wb.Save
wb.Close
Set xl=nothing
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 8:08 AM 0
comments
Friday, August 13, 2010

VBScript to write data in excel and Format


Dim xl
Set xl= CreateObject("Excel.Application")
xl.Visible = True
xl.Workbooks.Add
xl.Cells(1, 1).Value = "Name"
xl.Cells(1,2).value="Score"
Set r=xl.Range("A1","B1")
r.Font.Bold = TRUE
r.Interior.ColorIndex = 3
r.Font.ColorIndex = 2
xl.Cells(2, 1).Value = "venkatadri naidu"
xl.Cells(2, 2).Value = "80"
xl.Cells(3, 1).Value = "james"
xl.Cells(3, 2).Value = "70"
xl.Cells(4, 1).Value = "kiran"
xl.Cells(4, 2).Value = "60"
xl.Cells(5, 1).Value = "harish"
xl.Cells(5, 2).Value = "65"
Set r = xl.Range("A1","B5")
r.Font.Size = 14
Set r = xl.Range("A2","B5")
r.Interior.ColorIndex = 4
Set r = xl.ActiveCell.EntireColumn
r.AutoFit()
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 12:55 AM 0
comments
Tuesday, June 22, 2010
Descriptve code for Flight application
'Script for Login

Systemutil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"


with Dialog("text:=Login")
.WinEdit("attached text:=Agent Name:").set "abcd"
.WinEdit("attached text:=Password:").set "mercury"
.WinButton("text:=OK").click
End with
'Script for Insert new Record
With Window("text:=Flight Reservation")
.WinMenu("menuobjtype:=2").Select "File;New Order"
.ActiveX("acx_name:=MaskEdBox").Type "062610"
.WinCombobox("attached text:=Fly From:").Select "Denver"
.WinComboBox("attached text:=Fly To:").Select "Paris"
.WinButton("text:=FLIGHT").Click
.Dialog("text:=Flights Table").WinList("attached text:=From","nativeclass:=ListBox").Select 1
.Dialog("text:=Flights Table").WinButton("text:=OK").Click
.WinEdit("attached text:=Name:","nativeclass:=Edit").Set "james"
.WinButton("text:=&Insert Order").click
End With
'Script for open Record
With window("text:=Flight Reservation")
.WinMenu("menuobjtype:=2").Select "File;Open Order..."
with .Dialog("text:=Open Order")
.WinCheckBox("text:=&Order No.").Set "ON"
.WinEdit("window id:=1016").Set "1"
.WinButton("text:=OK").Click
End With
End With
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 1:28 AM 0
comments
Saturday, June 19, 2010
Spy Web Objects

Alternative Spy For Web Applications instead of QTP Object Spy

IE Developer ToolBar ( for IE)

DOM Inspector (for IE)

FireBug (for Firefox)

Internet Explorer Developer Toolbar (sometimes shortened to IE Developer Toolbar or even IE DevBar),
is an add-on for Internet Explorer 6 and Internet Explorer 7 that aims to aid in design and debugging of
web pages. It allows validating of CSS and HTML, previewing page layout at various resolutions, and also
offers a ruler (measuring in pixels) to aid in positioning the elements. It allows viewing the source of the
entire page, color coded for ease of navigation, or selected elements of it, as well as view the DOM
source and the CSS selectors that are applied to the element. It also enables viewing the properties and
styles of individual elements and also trace styles of elements to its declaration.
The toolbar includes a toggleable pane at the bottom of the window . The pane shows the structure of
the web page; and for each structure, the properties and styles. It exposes its features through a menu
hierarchy, and also includes toolbar buttons for quick access to features like clearing the browser cache
and enable selecting elements by clicking in the rendered page, rather than navigating through the
visual representation of the DOM tree

Example IE DevBar

Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 6:54 PM 0


comments
Thursday, May 27, 2010

Create Graph in Excel


'Create Graph in Excel using VBScript
dim xl,wb
set xl=createobject("Excel.Application")
xl.Visible = true
set wb = xl.workbooks.add
dim arr(19,9)
for i = 1 to 20
for j = 1 to 10
arr(i-1,j-1) = i*j
next
next
dim rng
set rng = wb.Activesheet.Range("A1").Resize(20,10)
rng.value = arr
wb.Charts.Add
wb.ActiveChart.ChartType =66
wb.ActiveChart.SetSourceData rng, 2
wb.ActiveChart.Location 2, "Sheet1"
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:17 AM 0
comments
Friday, May 21, 2010
Cloud Computing
Cloud Computing

Cloud computing is a general term for anything that involves delivering hosted services over the
Internet. These services are broadly divided into three categories:
Infrastructure-as-a-Service (IaaS),
Platform-as-a-Service (PaaS)
Software-as-a-Service (SaaS).

The name cloud computing was inspired by the cloud symbol that's often used to represent the Internet
in flowcharts and diagrams.

A cloud service has three distinct characteristics that differentiate it from traditional hosting. It is sold on
demand, typically by the minute or the hour; it is elastic -- a user can have as much or as little of a
service as they want at any given time; and the service is fully managed by the provider (the consumer
needs nothing but a personal computer and Internet access). Significant innovations in virtualization and
distributed computing, as well as improved access to high-speed Internet and a weak economy, have
accelerated interest in cloud computing.
A cloud can be private or public. A public cloud sells services to anyone on the Internet. (Currently,
Amazon Web Services is the largest public cloud provider.) A private cloud is a proprietary network or a
data center that supplies hosted services to a limited number of people. When a service provider uses
public cloud resources to create their private cloud, the result is called a virtual private cloud. Private or
public, the goal of cloud computing is to provide easy, scalable access to computing resources and IT
services.
Infrastructure-as-a-Service like Amazon Web Services provides virtual server instances with unique IP
addresses and blocks of storage on demand. Customers use the provider's application program interface
(API) to start, stop, access and configure their virtual servers and storage. In the enterprise, cloud
computing allows a company to pay for only as much capacity as is needed, and bring more online as
soon as required. Because this pay-for-what-you-use model resembles the way electricity, fuel and
water are consumed, it's sometimes referred to as utility computing.

Platform-as-a-service in the cloud is defined as a set of software and product development tools hosted
on the provider's infrastructure. Developers create applications on the provider's platform over the
Internet. PaaS providers may use APIs, website portals or gateway software installed on the customer's
computer. Force.com, (an outgrowth of Salesforce.com) and GoogleApps are examples of PaaS.
Developers need to know that currently, there are not standards for interoperability or data portability
in the cloud. Some providers will not allow software created by their customers to be moved off the
provider's platform.
In the software-as-a-service cloud model, the vendor supplies the hardware infrastructure, the software
product and interacts with the user through a front-end portal. SaaS is a very broad market. Services can
be anything from Web-based email to inventory control and database processing. Because the service
provider hosts both the application and the data, the end user is free to use the service from anywhere.

Tools for Cloud Testing : http://www.pushtotest.com/


Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 4:09 AM 0
comments

Future Testing
New trends in testing
New and emerging technologies such as Service Oriented Architecture (SOA), Software-as-a-Service
(SaaS), Cloud Computing, virtualization and advent of mobile technologies are radically changing the
trends in application testing. Some of the recent trends in software testing domain indicate an
upsurge in:
a) SOA Testing
b) Security testing
c) Testing in Cloud Computing environments
d) Tool based regression automation and performance testing
e) On-demand testing services
f) Risk-Based testing
g) VoIP application testing
h) Health care
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:44 AM

Tuesday, May 18, 2010


Few Additonal Scripts
'Shell Script- Open Notepad-write data and save file
Dim x
Set x=CreateObject("WScript.Shell")
x.Run "notepad.exe"
wait(5)
x.SendKeys "venkatgn"
wait(3)
x.SendKeys "^{s}"
wait(2)
x.SendKeys "file2"
wait(2)
x.SendKeys "{ENTER}"
==================================
'Read data from XML File
Set xd=CreateObject ( "Microsoft.XMLDOM")
xd.Async = "false"
xd.Load ( "e:\GVenkat\book.xml")
For Each b In xmlDoc.selectNodes ( "/Books/Book")
t= b.selectSingleNode ( "Title"). text
p=b.selectSingleNode ( "Price"). text
d=b.selectSingleNode ( "date"). text
MsgBox "Name:" & t & vbcrlf &"Price:" & p & vbcrlf & "Date " &d
Next
Set xd=nothing
===========================================
'Read Data from Database and save the read data into XML File
Dim cn,rs
Set cn=CreateObject("ADODB.Connection")
Set rs=CreateObject("ADODB.RecordSet")
cn.Open "Provider=SQLOLEDB;Server=sys;database=Northwind;Trusted_Connection=yes"
rs.Open "select employeeid,lastname,firstname,title from Employees ",cn
rs.Save "e:\r.xml",1
rs.Close
cn.Close
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 3:05 AM 0
comments

Friday, May 14, 2010


Decision Table
Decision Table show sets of conditions and the actions resulting from them when the logic can be easily
expressed in a table format
Developing Decision Tables
In order to build decision tables, you need to determine the maximum size of the table, eliminate any
impossible situations, inconsistencies, or redundancies, and simplify the table as much as possible. The
following steps provide offer some guidelines to developing decision tables:
1. Determine the number of conditions that may affect the decision. Combine rows that overlap, for
example, conditions that are mutually exclusive. The number of conditions becomes the number of rows
in the top half of the decision table.
2. Determine the number of possible actions that can be taken. This becomes the number of rows in the
lower half of the decision table.
3. Determine the number of condition alternatives for each condition. In the simplest form of decision
table, there would be two alternatives (Y or N) for each condition. In an extended-entry table, there may
be many alternatives for each condition.
4. Calculate the maximum number of columns in the decision table by multiplying the number of
alternatives for each condition.
you can refer
http://www.ibm.com/developerworks/rational/library/jun06/vauthier/
http://www.cems.uwe.ac.uk/jharney/table.html
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:47 AM 0
comments
Bank, Insurance
Good website links to understand BANKING,INSURANCE...etc
http://money.howstuffworks.com/personal-finance/banking/bank.htm
http://health.howstuffworks.com/health-insurance1.htm

Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:01 AM 0


comments
Thursday, May 13, 2010
Conv WR Script to QTP
WinQuick
WinQuick is a comprehensive HP WinRunner to QuickTest Pro migration platform that converts over
90% of the WinRunner code to QTP automatically. It is the fastest, most comprehensive and cost
effective technology to re-architect and migrate WinRunner based code and artifacts to QTP.
WinQuick is the only HP validated solution with proven customer track record.
WinQuick is HP PSOs recommended tool/service offering for WR to QTP migration.
Read More..http://www.win-quick.com/faq.html
QTPGenie
QTPGenie combined with Sierra Atlantics offshore services provide a 100% migration solution.
WinRunner scripts fed to QTPGenie are scanned and analyzed thoroughly to produce the most accurate
corresponding QTP output. In spite of the significant differences between WinRunner and QTP, the
logical test flow is preserved.
ReadMore:
http://www.sierraatlantic.com/downloads/products/Sierra_Atlantic_QTPGenie_Datasheet.pdf

WR2QTP
There are two approaches that one can take for migration:
1. Perform the conversion manually: This is a costly and error-prone process as the logic of each TSL
script has to be understood, the object map manually recorded and then the QTP scripts constructed.
This approach works only if the code base is small.
2. Build a language translator that automatically converts WinRunners GUI-map files and scripts to
QTPs object map files and scripts. Two companies have already built such translators in the past,
however, both these translators (Win-Quick and QTP Genie) convert only around 80% of the code. Rest
of the conversion has to be
done manually. This manual conversion step requires understanding the script code in order to correct
it. Significant investment of time is needed. One could argue that a translation-based approach that is
not nearly 100% automatic is no better than the manual approach.
INTEROPERATES DISRUPTIVE WR2QTP TRANSLATOR
Interoperate has recently developed a translator that converts WinRunner scripts to QTP with nearly
100% automation. Interoperates translator relies on a path-breaking Technology based on formal
semantics and rule-based languages that allows translators for the most complex languages to be
constructed in a few months as opposed to a few years.
ReadMore: http://www.interoperate.biz/Interoperate_WhitePaper%20WR2QTP.pdf

Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 10:11 PM 0


comments
Sunday, May 9, 2010
DOM and AOM Scripts
'Display all the Elements Tags and Text in the objects in Webpage
Set d=Browser("Google").Page("Google").Object
For Each e In d.all
TagName= e.TagName
InnerText = e.innerText
print TagName&" "&InnerText
Next
'Open Gmail and set the text in the Edit Box
systemutil.Run "www.google.com"
Set obj= Browser("name:=Google").Page("name:=Google").Object.getElementsByTagName("INPUT")
n=obj.Length-1
For i=0 to n
If obj(i).Name="q" and obj(i).Type="text" Then
Browser("name:=Google").Page("name:=Google").Object.getElementsByTagName("INPUT")(i).Value="V
enkatgn"
End If
Next
' Open the Script in QTP from QC and Run, Close the Test, QTP
Set app=CreateObject("QuickTest.Application")
app.Launch
app.Visible = True
Set qtpres=CreateObject("QuickTest.RunResultsOptions")
app.Open "[QualityCenter] Subject\Requirements\Login\tst_login", True
qtpres.ResultsLocation = "d:\qtpresults"
app.Test.Run
app.Test.Close
app.quit
set qtpres = Nothing
Set app = Nothing
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 10:23 PM 0
comments
Wednesday, May 5, 2010

DOM Scripts
Try the below Scripts using Document Object Model on Google web page
ADD Google webpage in Repository
s=Browser("Google").Page("Google").Object.cookie
msgbox s
s=Browser("Google").Page("Google").Object.documentElement.innerhtml
msgbox s
s=Browser("Google").Page("Google").Object.documentElement.innertext
msgbox s
s=Browser("Google").Page("Google").Link("Hindi").Object.currentStyle.color
msgbox s
s=Browser("Google").Page("Google").Link("Hindi").Object.currentStyle.fontfamily
msgbox s
s=Browser("Google").Page("Google").Object.readyState
msgbox s
s=Browser("Google").Page("Google").Object.url
msgbox s
s=Browser("Google").Page("Google").Object.getElementsByName("INPUT")
msgbox s
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 8:57 PM 0
comments
Sunday, May 2, 2010
Descriptive Example
''' Descriptive Code for Flight Application Login
Dim a,p,k
Set dl=fn_createobj("text:=Login")
Set a=fn_createobj("attachedtext:=Agent Name:,nativeclass:=Edit")
Set p=fn_createobj("attachedtext:=Password:,nativeclass:=Edit")
Set k=fn_createobj("text:=OK")

with Dialog(dl)
.WinEdit(a).set "abcd"
.WinEdit(p).set "mercury"
.WinButton(k).Click
End With
Function fn_createobj(s)
Dim d
Set d=Description.Create
n=split(s,",")
For i=0 to ubound(n)
m=split(n(i),":=")
d(m(0)).value=m(1)
Next
Set fn_createobj=d
End Function
=============================
'' Descriptive code to Enter Venkatgn in Google and read the results
with Browser("CreationTime:=0").page("micclass:=Page")
.WebEdit("name:=q","html tag:=INPUT","type:=text").Set "Venkatgn"
.WebButton("name:=Google Search","type:=Submit").Click
r= .webelement("innertext:=(\d*,\d*){1,}").getROProperty("innertext")
End With
msgbox "Total Results "&r
Browser("CreationTime:=0").Back
=================================
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 8:59 PM

Tuesday, April 27, 2010


WMI--Work With Registry
'''''''''''Read values from registry
HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&"."&
"\root\default:StdRegProv")
strKeyPath = "System\CurrentControlSet\Control\hivelist"
oReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath,arrValueNames, arrValueTypes
For i=0 To UBound(arrValueNames)
print "File Name: " & arrValueNames(i)
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,arrValueNames(i),strValue
print "Location: " & strValue
Next
--------------------------------------------------------------------''''''''' Create a new registry Key and values
HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&"." &
"\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Regnewv1"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strValueName = "vname1"
strValue = "venkat"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
strValueName = "DWORD Value Name"
dwValue = 82
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
--------------------------------------------------------'''''''''''Delete Registry key Values
HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &"."&
"\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Regnewv1"
strDWORDValueName = "DWORD Value Name"
strExpandedStringValueName = "Expanded String Value Name"
strStringValueName = "vname1"
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strDWORDValueName
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strExpandedStringValueName
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strStringValueName
----------------------------------------------------------------------------------------------------------------------

'''''''Delete registry key


HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &"."&
"\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Regnewv1"
oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath
--------------------------------------------------------------------------'''''''''Display List of softwares installed in the system
Set wmi=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &"." &"\root\cimv2")
Set sc=wmi.ExecQuery("SELECT * FROM Win32_Product")
If sc.Count > 0 Then
Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.CreateTextFile("d:\SoftwareList.txt", True)
For Each sl in sc
f.WriteLine sl.Caption & vbtab &sl.Version
Next
f.Close
Else
Msgbox "Cannot retrieve software from this computer."
End If
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 7:38 AM 0
comments
Friday, April 23, 2010
QTP AOM Scripts
'Script To open QTP and run Test
Dim app
set app=CreateObject("QuickTest.Application")
app.launch
app.visible=True
app.open "E:\venkatgn\Test1"
''Script to connect to Quality Center From QTP
Set app=CreateObject("QuickTest.Application")
app.Launch
app.Visible = True
app.TDConnection.Connect "QCURL","DOMAIN","PROJECT","USERNAME","PASSWORD",False
''Example : app.TDConnection.Connect

"http://192.168.1.1:8080/qcbin","Default","proj1","venkat",,false
'''Script to Connect to QC and Add a new Defect in QC from QTP
Dim qccon
Set qccon=CreateObject("TDApiOle.TDConnection")
qccon.InitConnection "http://qcserverurl:8080/qcbin"
qccon.ConnectProject "proj1","venkat",""
If qccon.Connected Then
Msgbox "Connected to QC Server
Else
MsgBox "Not Connected"
End If
Set BugFactory = qccon.BugFactory
Set Bug = BugFactory.AddItem(Nothing)
Bug.Status = "New"
Bug.Summary = "Error in login"
Bug.Priority = "4-Very High"
Bug.AssignedTo ="user1"
Bug.DetectedBy = "venkat"
Bug.Post
' Close QTP After execution of the Test
set wm=GetObject("winmgmts:\\.\root\CIMV2")
Set pros=wmi.ExecQuery("Select * from Win32_Process Where Name = 'QTPro.exe'")
For Each p in pros
p.Terminate()
Next
Set wmi=Nothing
Set pros=Nothing
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 5:11 AM 0
comments
Monday, April 19, 2010
Interview Scripts---3

1. How to return multiple values from a function ( VBScript)


2. How to load object repository during runtime

3. how to handle exceptions in VBScript


4. How do you parameterize data to your test
5. What is the Executable file of QTP
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:40 AM 0
comments
Friday, April 16, 2010
Interview Scripts-Try-2
1. Write Script to Import data from Excel To Datatable
2. Write Script to invoke Application
3. Write Script to read data from datatable
4. Write Script to connect to SQL server Database and read data from emp table
5. What is Difference between SystemUtil.Run & InvokeApplication
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 8:10 AM 0
comments
Thursday, April 15, 2010
VBScript - Excel Programming
''' Set the Color to the Cells in Excel
Set xl = CreateObject("Excel.Application")
xl.Visible = True
xl.Workbooks.Add
For i = 1 to 56
xl.Cells(i, 1).Value = i
xl.Cells(i, 1).Interior.ColorIndex = i
Next
''Read Data from MS-Excel using ADODB.Connection and RecordSet

'' Take few records of emp details in cells A1 to C4 for practise like eno, ename,sal

Dim cn,sSQL,rs,vRows, strtext


Set cn=CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cn.open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=e:\gvenkat\data.xls ;Extended
Properties=Excel 8.0"
rs.open "SELECT * FROM [Sheet1$A1:c4]", cn
i=0
while rs.eof<>True
for each field in rs.fields
if Trim(strtext)="" then
strtext=strtext & field.value
else
strtext=strtext & " " & field.value
end if
next
i=i+1
rs.moveNext()
Wend
rs.close
cn.close
vRows=Split(strtext,vbTab)
For i=0 to ubound(vRows)
print vRows(i)
Next

Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:48 AM 0


comments
Wednesday, April 14, 2010
Desc Ex : Calculator
sub TypeKey(vkey)
Select Case vKey
Case "*"
vKey = "\*"
End Select
With Window("nativeclass:=SciCalc")
.WinButton("text:=" & vKey).Click
End With
End Sub
TypeKey 5
TypeKey "*"
TypeKey 9
TypeKey "="
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 9:07 PM 0
comments
Tuesday, April 13, 2010
Descriptive Examples
' Script to Close the Recent browser opened

Dim d,brlist,idx
Set d=Description.Create
d("micclass").value="Browser"
Set brlist=Desktop.ChildObjects(d)
idx=brlist.count-1
Browser("creationtime:="&idx).close
Set d=Nothing
Set brlist=Nothing

'''' VBScript to Display All the Properties of All the objects in WebPage
Set d=Description.Create
Set App = CreateObject("QuickTest.Application")
Set qtIdent = App.Options.ObjectIdentification
qtIdent.ResetAll
set objList=browser("micclass:=Browser").page("micclass:=Page").ChildObjects(d)
For i=0 to objList.count-1
objList(i).highlight
oClassName=objList(i).getroproperty("micclass")
Set qtObject = qtIdent.Item(oClassName)
set PropColl=qtObject.AvailableProperties
print "*******************************************************"
For oPropCount=1 to PropColl.count
print PropColl.item(oPropCount) & ":="& objList(i).getroproperty(PropColl.item(oPropCount))
Next
print "*******************************************************"
Next
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 9:23 PM

Monday, April 12, 2010


Scripts Try-1
1. Write Script to get the count of values in WinCombobox
2. Write Script to get the x and y coordinates of a button
3. Write Script to find the Page Load Time
4. Write Script to search for a city in the wincombobox
5. Write script to check window is visible on the desktop or not.
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 10:08 AM 0
comments
QTP TIPS
QTP Tips
There are lot of QTP tips file in QTP installation folder which is developed by HP.
If you have installed QTP in your machine then find the file in this path QTP installation Folder -->Dat -->
Tips.txt.

The RegisterUserFunc statement now has an optional argument that you can use to set a
function as the default operation for a test object.

You can use the new Function Definition Generator to easily generate user-defined functions
(Insert > Function Definition Generator).

NEW!! You can manage the availability of keywords used to create keyword-driven components
using the new Keywords pane in the application area of QuickTest Professional.

NEW!! You can associate a function library with the open test by opening the function library
and choosing File > Associate Library 'library_name' with 'test_name'.

NEW!! You can check syntax errors by clicking CTRL + F7. If your script contains errors you can
view them in the new Information pane.

The Select Object for Step dialog box enables you to select a new object from your application. If
you select an object in your application that is not in the object repository, the object is added
to the object repository when you insert the new step.

You can select an object in the object repository and locate it quickly in your application using
the Highlight button in the ORM or ORE.

NEW!! You can locate an object in the object repository by pointing to an object in your
application. If the object exists in the object repository, it is highlighted.

NEW!! You can now add new objects to the object repository using filtering capabilities. For
example, you can choose to add only a selected type of object residing in a window or a web
page/frame.

NEW!! You can now associate multiple object repositories with an action or application area. In
previous versions of QuickTest Professional, you could associate only a single object repository
with a test asset.

NEW!! You can export object repository content to an XML file and import a new object
repository from an XML file.

The list of Utility objects available when you open the Step Generator from the Keyword View is
a sub-group of the list available when you open the Step Generator from the Expert View.

Open XML format used for report information now enables you to easily customize run reports
and integrate result information with other applications. Refer to the QuickTest online
documentation for a detailed description of the report's XML elements.

You can export test results to an HTML file to easily view the test results when you are not
working in a QuickTest environment.

You can write automation scripts to control virtually every QuickTest feature and capability
using the objects, methods, and properties included in the QuickTest Professional automation
object model.

Test object and method names are not case sensitive.

When you type VBScript keywords in the Expert View, the relevant VBScript syntax or blocks are
added to the test script.

You can now locate specified text strings in the Expert View, and replace them with text strings
that you specify. You can search for literal text or use advanced options to fine-tune your
search.

NEW!! You can select a block in the Expert View and press CTRL + M to comment this block.
Press SHFT + CTRL + M to uncomment the block.

NEW!! You can select a block in the Expert View and indent or outdent it by clicking the Indent
or Outdent toolbar buttons.

NEW!! You can control the layout of the QuickTest Professional Window by dragging and
dropping panes to a dockable, floating, and tabbed mode.

NEW!! To move a dockable pane without snapping it into place, press CTRL while dragging it to
the required location.

NEW!! To auto-hide all the tabbed panes, select the title bar of the active tabbed pane, rightclick and choose Auto Hide.

NEW!! When you rename a test object, you can choose whether to automatically update all
occurrences of the test object, or manually change the names in steps that use the renamed test
objects.

NEW!! You can copy objects from a shared object repository to the local object repository in
order to modify them.

NEW!! You can use the Object Repository Merge Tool to merge objects from two shared object
repositories into a single object repository.

NEW!! You can associate shared object repositories with multiple actions simultaneously, using
the Associate Repositories dialog box.

NEW!! You can resolve missing resources (such as missing object repositories and actions), using
the new Missing Resources pane.

You can use the Advanced Windows Applications Options dialog box to modify how QuickTest
records and runs tests on Windows applications. Choose Tools > Options > Windows
Applications tab > Advanced.

You can save the resulting data from the run-time Data Table to a file by inserting a
DataTable.Export statement to the end of your test.

To instruct QuickTest to wait for an object to open or appear during test run, use an Exist or
Wait statement.

To stop an analog step in the middle of a test run, click Ctrl + Esc, and then click the Stop toolbar
button.

If you want to create a bitmap checkpoint of multiple objects, select the object in the Object
Selection dialog box that includes all the objects you want your bitmap checkpoint to contain.

If you need to recover Active Screen files after you save a test without Active Screen files, rerecord the necessary steps or use the Update Run option to recapture screens for all steps in
your test.

You can use a PathFinder.Locate statement in your test to retrieve the complete path that
QuickTest uses for a specified relative path based on the folders specified in the Folders tab.

To maximize performance, load only the add-ins you need.

You can define a recovery scenario to handle unexpected behavior during your run session.

You can add new objects to the Object Repository from the Active Screen or using the Add
Objects option in the Object Repository dialog box and pointing to the object in your
application.

To record keyboard input, mouse clicks, and the exact path the mouse travels, switch to Analog
Recording mode or Low Level Recording mode.

If it takes time for an object you are checking to load all of its data, you can increase the
checkpoint timeout.

You can insert XML output values to your script.

You can verify that your XML is structured according to a specific schema.

You can specify a relative path when calling actions, functions, and other external files
associated with or referenced by a test or business component.

NEW!! You can create library files (containing VBScript functions, subroutines, classes, modules,
and so forth) in QuickTest Professional and associate them with your test or application area.
You can then call these functions (or other elements) from within your test assets.

NEW!! You can debug functions, subroutines and classes defined in a function library file in
QuickTest Professional.

You can create a user-defined function and register it as a test object method in order to
overwrite or add to existing test object functionality.

You can use the Reporter object to disable or enable messages to the Test Results.

You can record a test on one version of Microsoft Internet Explorer and then run it on other
browsers or versions.

To transfer control to the application while spying or inserting checkpoints on objects, press the
CTRL key.

You can check the content of an image in a Web page when you create an image checkpoint
using the Compare Image Content option.

You can use the Data Table to run the test several times, each time using different data.

By default, in order to conserve disk space, QuickTest does not save screen captures with your
test results for steps that pass. You can change the default setting in the Tools > Options > Run
tab.

The Active Screen loads faster if you clear the Load Images check box in the Web Page
Appearance dialog box (Tools > Options > Active Screen tab > Advanced button).

You can teach QuickTest to recognize any area of your application as an object by defining it as a
virtual object.

From QuickTest, you can run WinRunner tests and call TSL functions in compiled modules. The
results of the WinRunner test or function are integrated into the QuickTest test results.

To modify the text used for a text checkpoint, click the Configure button in the Text Checkpoint
Properties dialog box.

You can configure an action for repeated use in your test and in other tests. Select the Reusable
Action check box in the Action Properties dialog box (Edit > Action > Action Properties).

You can use the ExitAction statement to terminate an action before it finishes running, based on
conditions you specify in your test.

You can set breakpoints in your test, and then use the Debug Viewer pane to view, set, or
modify the current value of objects or variables.

You can call methods and retrieve and set COM object properties from the Expert View using
the .Object property.

You can configure how QuickTest records events in Web applications. Choose Tools > Web Event
Recording Configuration.

You can define custom environment variables for use in your test.

You can add logic to a checkpoint by using a Data Table formula.

You can use the Window Script Host and the VBScript Runtime Library to further extend your
test. For more information choose Help > QuickTest Professional Help > VBScript Reference.

You can use the Object Identification dialog box to configure the way QuickTest learns and
recognizes objects.

You can run your test in Update mode to update values in your test or business component. You
can choose to update checkpoint data, Active Screen images, and/or the descriptions of the
objects in the object repository. Choose Automation > Update Run Mode.

If you want to add the same comment to every action that you create, you can add the
comment to an action template.

You can define test or action parameter variables using the Parameter object and its methods in
the Expert View.

You can create test, action, or component parameter output values that retrieve values during
the run session and store them for use at another point in the run session. You can then use
these output values to parameterize a step in your test or business component.

NEW!! You can create object repository parameters. When associating an object repository to a
test asset, you map this parameter to a constant or a test asset parameter (test, action, or
business component).

In addition to Data Table output values, you can output values to environment variables or store
a retrieved value in a test, action, or component parameter.

You can use the Data Driver Wizard to automatically parameterize constants in your action or
business component.

You can set a parameter to use a random numeric value.

You can specify test, action, or component parameters to pass values to and from your test or
business component, and between actions in your test.

Keyword view tips

The Operation item appears in the Keyword View only when functions are defined in function
library files associated with the components application area.

When adding a new step using the Keyword View or Step Generator, you can select a new
object from your application and it is automatically added to your object repository.

You can specify which columns you want to display in the Keyword View. Choose Tools > View
Options or right-click any column header in the Keyword View.

You can specify the order in which columns are displayed in the Keyword View. Choose Tools >
View Options or drag a column header to a new location in the Keyword View.

You can print the contents of the Keyword View to your Windows default printer, or preview it
on screen before printing. Click the Print button or choose File > Print.

You can copy and paste or drag and drop steps in order to move them to a different location
within the Keyword View.

You can enter a comment about a step in the Keyword View by clicking in the Comment cell. You
can also enter a comment on a new line below the currently selected step by choosing Insert >
Comment.

You can view the Documentation column in the Keyword View to read a summary of what the
step does, in an easy-to-understand sentence.

The Function Definition Generator enables you to add documentation that specifies exactly
what a step using your function does. This description is shown in the Documentation column of
the Keyword View for steps that use the function.

NEW!! You can copy the content of the Documentation column to the Clipboard by right-clicking
any column header in the Keyword View and choosing Copy Documentation to Clipboard.

You can print a single action or business component from the Keyword View (in table format) or
from the Expert View (in statement format).

You can create a custom report message from the Keyword View by choosing Insert > Report.

Tips When connected with QC

You can create multiple application areas to suit different components.

NEW!! Business components associated with an application area use only the resources and
settings that are defined in the application area. In previous versions of QuickTest Professional,
business components could have custom settings.

Iterations for a business component are defined in Quality Center.

If you are connected to Quality Center, you can view the current Quality Center connection by
pointing to the Quality Center icon in the status bar. To open the Quality Center Connection
dialog box, double-click the Quality Center icon.

If a Quality Center test or shared file (such as a shared object repository or Data Table file) is
open when you disconnect from Quality Center, then QuickTest closes it.

To access QuickTest tests or components from Quality Center, select the 'Allow other Mercury
products to run tests and components' check box (Tools > Options) and install the QuickTest
Add-in for Quality Center (from the QuickTest Professional CD-ROM).

NEW!! If a business component is currently open, clicking the New toolbar button creates a new
business component document (and not a new test document). This also applies if an
application area or function library is open.

NEW!! You can open a recently used business component, application area, or function library
by selecting it from the Recent Files list in the File menu.

You can run QuickTest tests from a Quality Center project and pass parameter values to the test.

You can choose a Web server accessible via a Local Area Network (LAN) or a Wide Area Network
(WAN) when connecting to Quality Center. Click the Quality Center Connection button or choose
File > Quality Center Connection.

The Open Test from Quality Center Project dialog box displays icons that indicate the version
control status of each test in your project.

Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 10:03 AM 0


comments
Saturday, April 10, 2010
VBScript Examples
''Example on Internet Explorer
Set ie = CreateObject("InternetExplorer.Application")
'set the ie properties
ie.ToolBar = 0
ie.StatusBar = 1
ie.Width = 999
ie.Height = 999
ie.Left = 0
ie.Top = 0
ie.Visible = 1
'navigate to a web page
ie.Navigate("http://www.google.com")
===================================
''Example on using Excel, VBScript
dim ex,wb,ws,row,column
set ex=CreateObject("Excel.Application")
ex.visible=true
set wb=ex.Workbooks.add
set ws=wb.Sheets("Sheet1")
for row=1 to 5
for column=1 to 10
ws.cells(row,column).value="Cell(" & row & "," & column & ")"
next
next
dim val
for row=1 to 5
for column=1 to 10
with ws.cells(row,column)

.value="updated_" & .value


end with
next
next
for column=1 to 10
ws.columns(column).AutoFit()
next
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 10:58 PM 0
comments
FAQ-4
1. what is executable file of QTP
2. What is error, defect, bug and failure
3. Explain Defect life cycle
4. what is SDLC and STLC
5. What is project Testing and Application Testing
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 1:35 AM 0
comments
Wednesday, April 7, 2010
FAQ-3
1. How to run QTP Scripts from QC
2. How to Export TCs from Excel to QC
3. What is Fuzz Testing
4. What is Story board Testing
5. What is defect Triaze, defect density,defect clustering
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 6:15 AM 0
comments
Saturday, April 3, 2010

FAQ-2
1. What is difference between QTP 9.2 , QTP 9.5 and 10.00
2. What is difference between low level recording and analog recording.
3. How to parameterize data to the QTP.
4. how to load Object Repository during RunTime
5. what is local and shared repository.
6. what is the extension of QTP Script file
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 4:31 AM 0
comments
Friday, April 2, 2010
Manual FAQ-1
1. what is Defect Triaze
Triaze meeting is conducted to list all the open defects and list which are possible to fix and not possible
to fix because of schedule.
2. Defect cluster
Defects are found in groups
3. Explain Defect life cycle
4. Explain the levels of Testing
unit testing, integration testing, system testing
5. what is alpha testing and beta testing
6. What is verification and validation
7. what is prototype
8. What is project TEsting and product TEsting
9. What is webservice
10. What is intranet and Internet
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:00 AM

Monday, March 29, 2010


Diff b/w QTP 9.2, 9.5, 10.00

Differences between QTP 9.2, QTP 9.5 and QTP 10.00

Hi,
Below are the differences you can tell between the QTP versions; those who are putting up QTP
experience; in the project point of you it is suggested to put QTP 9.2 / 9.5 but you can mention in the
Skill set that QTP 10.00 you have knowledge

Note: All the new Features of QTP 9.5 are available in QTP 10.00 and QTP 10.00 has new features
compared to QTP 9.5

New Features of QTP 9.5 which are not in QTP 9.2

Maintenance Run Mode :


Repair the object properties in the Repository if the properties are changed in the application in new
build.
Process Guidance :
This is little more than more accessible help files. Maybe this is good for when you are first learning to
record a test, but it doesnt seem to add much utility.
Test Flow Pane
Display the list of Actions in the Test and the sequence they are executed
Available Keywords Pane
All Test Objects and functions in are displayed.Rapid test development with drag & drop of objects,
functions into expert view. And Object repository now also supports drag & drop
Resources Pane :
All resources associated with the test. You can see all your library file in this pane

Missing Resources Pane


Display the List of resources associated to the test but not available in the location during runtime
Relative Path Helper
Improved Bitmap Checkpoint
Bitmpap Checkpoint has Tollerence values for pixels and color
Web Extensibility :
1.Anyone can add support for new web controls
2.Rapid development in JavaScript
3.Solid infrastructure supplied by the Web add-in
4.Extensibility objects are first class citizens
5.Built-in toolkit: ASPAjax
Tabbed browsing :
Tabs identified as separate browsers.Same test compatible with tabbed and non tabbed browsers.

New Technologies :
1.PowerBuilder
2. Delphi
3. Oracle Forms 10 Apps 12
4.StingRay Objective Grid 10, 114. PeopleSoft 9.0
5.New Terminal Emulator versions
6.NET 3.5 (beta)
New environments :
1.Windows Vista 64 bit
2. Eclipse 3.2, 3.3
3.Record on SWT

4. Firefox 3.0
5.Netscape 9
New Features of QTP 10.00
1. Centrally Manage and Share Testing Assets, Dependencies, and Versions in Quality Center 10.00
In the earlier version of QC, the Test Assets like ( Repository, Library, Recoveries ) are placed in the
Attachments and if these assets are associated to the Test there is no dependencies information.
In QC 10.00 there is a new Section called Test Resources in the section we can place all the Assets and
associate these to the Test Script. The QC tool maintains the dependencies information between the
Assets and Test Script.
It also provides build in Version control; when the Test case/ scripts ...etc is checkout and checkin into
QC it will maintain a new version which is similar concept in VSS.
2. Perform Single-User Local System Monitoring While Running Your Tests
we can observe the performance of the local system when the script is executed. Like usage of memory,
GDI objects, Thread counters.
Navigation: To select the Local System Motitoring
File menu-->Settings--> Local System Monitoring
Select the Enable Local System Monitoring every seconds
Select the Application name
Select the counter and Limit size
After the Test Run, the status is shown in the Test Results
3. Improve Portability by Saving Copies of Tests Together with Their Resource Files
When we save the test from QC into local system ; all the associated assets like Object Repositories,
Function Libraries, Recovery Scenarios are also copied to the local system and we can run the script
from local system with out any change in the assoication assets path / with out any changes.
Steps :
Open the Test in QTP which is in the QC
File menu select Save Test with Resources
Following type of details are displayed
select the location in local system to save the file and save
4. Call Actions Dynamically During the Test Run
we can dynamically load and run actions instead of Call to Existing action and associating the reusable
Actions. These action is loaded into memory and run only when the statement is executed and not
during the Test / Action open.
Syntax: Loadandrunaction Path of QTP test,Actioname
5. Develop Your Own Bitmap Checkpoint Comparison Algorithm

6. Centrally Manage Your Work Items and ToDo Tasks in the To Do Pane
we can make a note of all the tasks to be perfomed in the TODO Pane
View menu--> To Do List
7. Improve Test Results Analysis with New Reporting Functionality

A. Export Results Report


The results can be exported to DOC, PDF files also apart from HTML.
In the Results window ; File menu--> Export Report
B. Reporter.ReportEvent
During the script execution for any failed steps we can capture the bitmap and display it in the results
window along with Reporter.ReportEvent method
Example:
If condition is falied then
Window(Flight Reservation).CaptureBitmap b1.bmp
Reporter.ReportEvent 1,Error,The error message in the window,b1.bmp
End if
C. Jumping to a Step in QuickTest
We can view the step in QuickTest that corresponds to a node in the run results tree.
To view the step in the test that corresponds to a node:
Select a node in the run results tree.
Perform one of the following:
Click the Jump to Step in QuickTest button from the Run Results toolbar.
Right-click and select Jump to Step in QuickTest from the context-sensitive menu.
Select View > Jump to Step in QuickTest.
The QuickTest window is activated and the step is highlighted.
8. Test Standard and Custom Delphi Objects Using the Delphi Add-in and Delphi Add-in Extensibility
We can use the QuickTest Professional Delphi Add-in to test objects in Delphi applications. We can
create and run tests and components on these objects, as well as check their properties. We create and
run tests and components on Delphi applications in much the same way as you do for other Windowsbased applications.
The Delphi Add-in provides test objects, methods, and properties that can be used when testing objects
in Delphi applications
Product Enhancements
1.Upgrade from QuickTest 9.5
If QuickTest 9.5 is installed on the computer, we can choose to upgrade to QuickTest version 10.00. This
enables us to continue using many of the configurations and options we have already set in QuickTest
9.5. We can also use an msi silent installation command line to upgrade from QuickTest 9.5.
2.Improved IntelliSense Functionality
QuickTest now provides full IntelliSense for the following types of objects:
Objects created by a step or function (for example, by calling the CreateObject method)
Variables to which an object is assigned
Reserved objects
COM objects
3.Added Control for Editing and Managing Actions in Automation Scripts
The QuickTest Professional Automation Object Model has a new set of objects and methods for

manipulating test actions and action parameters. We can now use automation scripts to create new
actions, modify and validate the syntax of action scripts, create and modify action parameters, and
more.
4.Improved Debugger Pane Design and Functionality
The Debug Viewer pane has a new look, including icons to help us identify the type of information
displayed.
The Watch tab and Variable tab now display the types of expressions or variables, in addition to their
names and values.
The Command tab now displays the command history (in read-only format) in addition to the command
line, enabling us to view previously-run commands and select commands to reuse.
In addition, a right-click context menu in the Command tab enables us to:
copy from the command history and edit the command line using the clipboard.
clear the command history.
5.New Object Identification Solutions in Maintenance Run Mode
In addition to helping us update the steps and object repositories when objects in the application
change, the Maintenance Run Wizard can now help to solve the following problems:
The step failed because the object in the test is missing from the action's associated object repositories.
The object in the step exists in the application, but can be identified only through Smart Identification.
6.Additional Configuration Settings for Text Recognition Mechanism
We can now set all text recognition configuration settings from the QuickTest Options Dialog Box (Tools
> Options > General > Text Recognition), including new options for selecting the text block mode and
specifying the languages to be used with the OCR mechanism. This makes it easier to make any
necessary adjustments and to optimize the way that QuickTest identifies text in the application.
7.New Look for Options, Settings, and File Dialog Boxes
8.QuickTest Toolbar Customization Options
We can use the new Customize Dialog box (Tools > Customize) to customize the appearance of existing
menus and toolbars, and to create our own user-defined menus, toolbar buttons, and shortcuts.
We can also add new commands to the QuickTest Tools menu so that we can launch an application
directly from the menu. For example, we can use this option to create a shortcut to the application we
want to test or to an automation script.
9.Improved Web Extensibility
10. .NET Add-in and Extensibility Improvements
11.New Terminal Emulator Configuration Validation
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 5:01 AM 1
comments
Friday, March 19, 2010
Good Websites
Good websites to know more knowledge on Banking domain and Insurance Domain

http://www.howbankswork.com/
http://www.irdaindia.org/
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 4:09 AM 0
comments
Tuesday, March 9, 2010
QTP File Extensions

QTP Script File : .mts ( mercury test script)

QTP Local Repository : .bdb ( berkely database)

Shared Repository : .tsr ( test shared repository)

Load test configuration file :Default.cfg

Load test configuration file :Default.usp

Test.Tsp ---- Test Settings File

Parameters.mtr-------- Test Parameters file

Default.xls-------- Datatable ( Excel file)

Resource.mtr-------- contain the resources associated information like function library, recovery,
shared repository

Recovery Scenario -------- .qrs

Function library-----------.vbs / .qfl / .tst

Test Batch--------------- .mtb

Action Template--------- .mst ( mercury shared template)

Virutal Object---------- .vot ( virtual object template)

lock.lck------------- Created when the QTP test is open

Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 5:15 AM 0


comments
QTP best Practises
QTP Best Practices

Just record-and-playback is never the solution for any project.

Launch QTP using a .vbs file and not the QTP desktop icon. You will notice a substantial increase
in speed.

For large tests, always define variables; function in an external .vbs file and not inside a reusable
action. Attach these files with your test scripts.

If you define a variable or a function in an action, on every iteration of your test run, memory
(RAM) will be allocated to those variables/functions and would not be released. Now as your
script starts consuming more and more RAM, your System Under Test (SUT) will tend to become
slower.

While running, QTP consumes a lot of memory by itself. It is always advisable to have lots of
available RAM (much more than what is recommended by HP) and good processor speed on a
system where you intend to install QTP.

When you have tests (and hence QTP) running for a prolonged period if time, there are chances
of memory leaks. To avoid memory leakages always restart QTP at some intervals of time. Using
AOM you can automate this process. [If you want to go into details of effect of RAM on speed of
computer read the post on RAM, Memory Usage thoroughly]

Avoid using hard coded wait(x) statement. Wait statement waits for full x seconds, even if the
event has already occurred. Instead use .sync or exist statement. While using exists statement
always has a value inside it.

For ex: .Exist(10) Here QTP will wait max till 10 seconds and if it finds the object at (say) 3 secs ,
it will resume the execution immediately thereby saving your precious time. On the other hand
if you leave the parenthesis blank, QTP would wait for object synchronization timeout you have
mentioned under File > Test Settings > Run Tab.

Make full use of what HP-QTP has provided you in the tool IDE. Use Automatically Generate
With statements after recording option present under Tools > Options > General Tab. This
will not only make your code look neater but also make your scripts perform better.

Make your own judgment whether you want to go for Descriptive Programming or Object
Repository or mixed approach. Each approach has it own pros and cons that in turn is related to
QTP performance.

Unless absolutely required, uncheck the options Save still image capture to results and Save
movie to results present under Tools > Options > Run tab. These options definitely have some
bearing on QTP run time performance.

Make the Run Mode as fast. This setting is present under Tool > Options > Run tab. Note: If
you intend to run your scripts from QC no need to worry about this option, as the scripts WILL
run in fast mode whether you want or not.

Make use of relative paths while calling reusable actions in your script. Using relative path would
make your script portable and easy to manage. I will cover in detail how tos and whys of using
relative paths in my next post.

Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 4:46 AM 0


comments
Tuesday, March 2, 2010
SQL Queries
1. select all the records from titles table
select * from titles

2. select all the books price>=20 rupees


select title,type,price from titles
where price>=20
3. select all the titles price between 10 and 20 rupees
select title,type,price from titles
where price>=10 and price<=20
select title,type,price from titles
where price not between 10 and 20

4. select all the titles not between 10 and 20 rupees


select title,type,price from titles
where price <10 or price>20
5. select the publishers from AP and DC
select pub_name,state from publishers
where state='AP' or state='DC'
6. select the titles where price is null value
select * from titles
where price is null

7.select the titles having price


select * from titles
where price is not null
8.select all the titles not starting with s
select * from titles
where title not like 's%'
9. select all the titles expect business, mod_cook, trad_cook
select * from titles
where type not in('business' ,'mod_cook' ,'trad_cook')
10. select the sum of prices for the titles grouped by type
select type, sum(price) 'Total' from titles
group by type
select type, count(title_id) 'count of books' from titles
where type in ( 'mod_Cook','psychology','business')
group by type
having count(title_id)>3
order by type desc

11. select titles order by price


select * from titles
order by price
12. using joins
select title,pub_name,au_fname,au_lname
from titles t
join publishers p
on t.pub_id= p.pub_id
join titleauthor ta
on t.title_id=ta.title_id
join authors a
on ta.au_id=a.au_id

select * from publishers


where pub_id not in(select pub_id from titles)

select * from publishers


where pub_id in(select pub_id from titles)

select * from publishers


where pub_id in( select pub_id from titles
group by pub_id
having count(pub_id)>5)

select * from titles


where price in(select min(price) from titles
where price in(select top 2 price from titles
order by price desc))
=========================Delete duplicate records in the table
select distinct * into #t1
from emp1
delete from emp1
insert into emp1
select * from #t1
=====================
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:15 AM 0
comments
Monday, February 8, 2010
Testing Terminology
Terminologies from PerfTestplus.com
Quality - Value to some person. - Jerry Weinberg
Bug - Anything that threatens the value of the product. Something that bugs someone whose opinion
matters. - James Bach
Software Testing - An empirical, technical investigation conducted to provide stakeholders with
information about the quality of the product or service under test. - Cem Kaner

Exploratory Testing:
An interactive process of simultaneous learning, test design, and test execution. - James Bach
A style of software testing that emphasizes the personal freedom and responsibility of the individual
tester to continualy optimize the value of his or her work by treating test-related learning, test design,
test execution and test results interpretation as mutually supportive activities that run in parallel
throughout the project. - Cem Kaner
Heuristic Testing - An approach to test design that employs heuristics to enable rapid development of
test cases. - James Bach
Risk-Based Testing - Any testing organized to explore specific product risks. - James Bach
Test Design - The process of creating tests. - James Bach
Test Execution - The process of configuring, operating, and observing a product for the purpose of
evaluating it. - James Bach
Test Logistics - The set of ideas that guide how resources are applied to fulfill the test strategy. - James
Bach
Test Strategy - The set of ideas that guide test design. - James Bach
Software Performance Testing - An empirical technical investigation conducted to provide stakeholders
with information about the quality of the product or service under test with regard to speed, scalability
and/or stability characteristics. - Scott Barber
Software Performance Investigation - A deliberate data-collection and data-interpretation activity
typically focused on data related to speed, scalability, and/or stability of the product under test. The
collected data are primarilly used to assess hypotheses about the root cause of one or more observed
performance issues. - Scott Barber
Software Performance Validation - A deliberate activity that compares speed, scalability and/or stability
characteristics of the product under test to the expectations of representative users of the product. Scott Barber
Software Performance Requirements - Performance related characteristics of the product under test
that must be met in order for the product to be released. Performance requirements are mandated via
legal contract or service level agreement. - Scott Barber
Software Performance Goals - Performance related characteristics of the product under test that are
desired to be met prior to product release, but which are not strictly mandatory. - Scott Barber

Performance Testing Objective - Information to be collected through the process of performance


testing that is anticipated to have value in determining or improving the quality of the product, but are
not necessarily quantitative or directly related to a performance requirement, goal or stated Quality of
Service. - Scott Barber
User Community Model - Models that enhance the application usage profile(s) by adding distribution of
activities, hourly usage volume and other necessary variables to design realistic performance tests. Scott Barber
Load Test - A performance test focused on determining or validating performance characteristics of the
product under test when subjected to workload models and load volumes anticipated during production
operations. - Scott Barber
Stress Test - A performance test focused on determining or validating performance characteristics of the
product under test when subjected to workload models, and load volumes beyond those anticipated
during production operations. Stress tests may also include tests focused on determining or validating
performance characteristics of the production under test when subjected to workload models and load
volumes when the product is subjected to other stressful conditions, such as limited memory,
insufficient disk space or server failure. - Scott Barber
Spike Test - A performance test focused on determining or validating performance characteristics of the
product under test when subjected to workload models and load volumes that repeatedly increase
beyond anticipated production operations for short periods of time. Spike testing is a subset of stress
testing. - Scott Barber
Endurance Test - A performance test focused on determining or validating performance characteristics
of the product under test when subjected to workload models and load volumes anticipated during
production operations over an extended period of time. Endurance testing is a subset of load testing. Scott Barber
Application Speed - Characteristics of the product under test related to the product's overall speed of
response, or sub-system's speed of response, to a user initiated activity - Scott Barber
Application Scalability- Characteristics of the product under test related to the number of users the
product can support. These Characteristics or Qualities of Service may be related to user load, network
or data capacity and/or product failure modes related to the product's inability to scale beyond a
particular level. - Scott Barber
Application Stability - Characteristics of the product under test related to the product's overall
reliability, robustness, functional and data integrity, availability and/or consistency of responsiveness
under a variety of expected and unexpected conditions. - Scott Barber

Application Usage Profile - One or more descriptions of how the product under test is, or is anticipated
to be, used during production operations. Usage profiles are typically expressed in terms of business
activities and usage scenarios. - Scott Barber
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:18 AM 0
comments
Monday, December 14, 2009
Project Testing CheckList
Testing Project Checklists
1. Project Initiation
a. Prepare System Test Estimates
b. Define System Test Approach
c. Define Testing Scope
d. Prepare DRAFT System Test Plan
e. Review System Test Plan
f. Prepare Test Schedule
g. Request Test Resources
h. Request Business Expert
i. Request Management Support
j. Request Environment/Technical Support
k. Request Test Hardware (pcs & servers)
l. Request Facilities (desks, chairs etc.)
m. Setup Test Project Folder
n. Revise Test Estimates
o. Define Entrance/Acceptance Criteria
p. Agree Communication Channels
q. Agree Reporting Procedures, Method & Frequency
r. Define Exit Criteria
s. Design Release Notes Template
2. Test Preparation
a. Agree Builds/Drops Schedule & Contents
b. Agree Release Notes Contents & Format
c. Agree Error Management Procedures
d. Define & Agree Error Management Roles
e. Define System Test Roles & Responsibilities
f. Assign Test Roles & Responsibilities
g. Assign Test Case Preparation Primary Responsibilities
h. Assign Test Case Preparation Secondary Responsibilities

i. Prepare High Level Test Cases


j. Prepare Detailed Low Level Test Cases
k. Define Test Environment Setup (Network/Server)
l. Define Test PC Setups & Configurations (clients)
m. Review Test Plan
n. Review Test Schedule
o. Setup Test Execution Progress Tracking Database
3. Build System Test Environment
a. Setup Test Environment (server)
b. Setup Test PCs
c. Setup Bug Database
d. Verify Test Environment (shakedown)
e. Verify Bug Database External Access
f. Setup Test Data
g. Setup & Install Test Peripherals (card readers, receipt printers)
h. Prepare System Test
i. Review System Test Cases
j. Revise System Test Cases
k. System Test Readiness Review
l. Verify Entrance Criteria Reached
m. Receive B36 Build 1
n. Install B36 Build 1
o. Execute Acceptance Tests
p. Review Acceptance Test Results (accept yes/no)
5. Execute System Test
a. Execute System Test
b. Execute Cycle 1 - GUI Tests
c. Execute Cycle 2 Functional Tests
d. Execute Cycle 3 Scenario Tests
e.. Log & Track Defects
f. Maintain & Administer Error Management System
g. Progress Measurement & Reporting
h. Measure Progress Actual vs Planned
i. Manage & Track new builds
j. Perform Build Regression Tests
k. Regression Test Fixed Bugs
l. Close Regressed Bugs / Re-open Not Fixed bugs
m. Measure Error statistics & Metrics
n. Report Error Statistics & Metrics
o. Track & Record Error Turnaround Time

p. Escalate Issues as appropriate


r. Perform Final Regression Test
6. Signoff
a. Signoff System Test
b. Produce Post-Testing Report
c. Washup & Lessons Learnt Meeting
d. Review Exit Report
e. Cleanup Test Environment
f. Return Peripherals
g. Post Execution Test Case Review
h. Handover Test Documentation
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:13 AM 0
comments

Monday, December 14, 2009


CheckList for Win & Web
Check List for Windows Application Testing
1 - Windows Compliance Standards
a. Application
b. For Each Window in the Application
c. Text Boxes
d. Option (Radio Buttons)
e. Check Boxes
f. Command Buttons
g. Drop Down List Boxes
h. Combo Boxes
i. List Boxes
2. Tester's Screen Validation Checklist
a.Aesthetic Conditions
b.Validation Conditions
c. Navigation Conditions
d. Usability Conditions
e. Data Integrity Conditions
f. Modes (Editable Read-only) Conditions
g. General Conditions
h. Specific Field Tests
i. Date Field Checks
ii.Numeric Fields
iii.Alpha Field Checks
3 .Validation Testing - Standard Actions
a. On every Screen
b. Shortcut keys / Hot Keys
c. Control Shortcut Keys
4.Origin & Inspiration
a. Document origin
b. Sources of Inspiration & information
c. Contacting the author.
===============================
Check List For Web Application Testing
1) Functionality Testing
Check all the links:

Test forms in all pages:


Cookies testing:
Validate your HTML/CSS
Database testing:
2) Usability testing
Test for navigation:
Content checking:
Other user information for user help
3) Interface testing
4) Compatibility testing
Browser compatibility
Operating system compatibility
Mobile browsing
Printing options
5) Performance testing
Web Load Testing
Web Stress Testing
6) Security testing
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 1:47 AM 2
comments
Friday, November 27, 2009
Descriptive Code--1
Learn Descriptive coding------1

We can use this programming to recognized similar type of objects. in this code the properties of the
objects is used in the script only. , no need to depend on the object repository.
Example:1Login into Flight Application
Dialog("text:=Login").WinEdit("attached text:=Agent Name:").Set "venkat"
Dialog("text:=Login").WinEdit("attached text:=Password:").Set "mercury"
Dialog("text:=Login").WinButton("text:=OK").Click
Example : 2--- Login into yahoo , click inbox , select a mail and delete

with Browser("CreationTime:=0").page("micclass:=Page")
.WebEdit("name:=login").Set "venkat"
.WebEdit("name:=passwd").Set "12345678"
.webbutton("name:=Sign In").Click
.link("text:=inbox\s\(\d*\)").Click
.WebCheckbox("index:=2").Set "ON"
.WebButton("name:=Delete","index:=0").Click
.link("text:=Sign Out").Click
End with
Example : 3--- Display the List of links in Google home page
Dim d
Set d=Description.Create
d("micclass").value="Link"
set a=Browser("CreationTime:=0").page("micclass:=Page").ChildObjects(d)
For i=0 to a.count-1
print a(i).getROProperty("innertext")
Next
Example : 4Display the data from all the edit boxes in Flight application
Dim d
Set d=Description.Create
d("micclass").value="WinEdit"
Set a=Window("text:=Flight Reservation").ChildObjects(d)
For i=0 to a.count-1
print a(i).getROproperty("attached text")&" "&a(i).getROProperty("text")
Next
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 4:05 AM 3
comments
QTP Cert Questions
HP QTP CERTIFICATION

Q: 1 When a procedure is created in the Function Library editor, what is the extension on the file?
A. .INI
B..TXT
C. .QFL
D. .VBS
Q: 2 What are the categories in the Step Generator?

A. Object, Operation, Value


B. Library, Built-in, Local Script
C. Operation, Arguments, Return Value
D. Test Objects, Utility Objects, Functions
Q: 3 In Test Settings ->Run the Data Table iteration options are for which data sheet?
A. Local
B. Global
C. Run-time Data Table
D. Design-time Data Table
Q: 4 What can you use to handle unpredictable testing exceptions?
A. A Do Loop
B. Recovery Scenario
C. IFHEN statement
D. Selectase statement
Q: 5 In which command can you associate a function library to a test?
A. Run Options
B. Test Settings
C. View Options
D. Function Definition Generator
Q: 6 Where do you set the action iterations for a specified action?
A. Action Settings
B. Action Properties
C. Action Run Settings
D. Action Call Properties
Q: 7 Where do you mark an action as reusable?
A. Action Settings
B. Action Properties
C. Action Run Settings
D. Action Call Properties
Q: 8 After running a test that contains both input and output parameters, wherecan the results of an
output parameter be found?
A. Local DataSheet
B. Global DataSheet
C. Run-time Data Table
D. Design-time Data Table

Q: 9 If you have a Virtual Object Collection stored on your machine, and you don't want to use it, what
must you do?
A. Disable Virtual Objects in Test Settings
B. Remove the Collection from your machine
C. Disable Virtual Objects in General Options
D. Remove the Collections from the Resources list
Q: 10 Which method for the DataTable utility object will allow you to retrieve information from the
Data Table during a test run?
A. Value
B. Import
C. GetCell
D. GetValue
Q: 11 What does the source property of a database checkpoint object represent?
A. The SQL query
B. The identification number of the database
C. The number of rows returned from the query
D. The connectionstring used to connect to the database
Q: 12 What is created, by default, with each new action?
A. Local Data Sheet, Global Data Sheet, Folder
B. Local Object Repository, Local Data Sheet, Folder
C. Global Data Sheet, Local Object Repository, Folder
D. Local Data Sheet, Global Data Sheet, Local Object Repository
13 What are the available environment variable type(s)?
A. Built-in
B. User-defined
C. User-function
D. Built-in, User-defined
E. Built-in, User-function
14 If the Global Data sheet contains no data and the Local Datasheet contains two rows of data, how
many times will the test iterate?
A. 1
B. 2
C. 3
D. 5
15 What is the first thing that must be defined in a Recovery Scenario?
A. Trigger

B. Recovery Operation
C. Recovery Scenario Name
D. The Function used in the scenario
16 What are bitmap checkpoints sensitive to?
A. Image size and object type
B. Object type and image type
C. Screen resolution and object type
D. Screen resolution and image size
17 If the Local Data sheet contains two rows of data, how many times will the action iterate, by
default?
A. 1
B. 2
C. 3
D. 5
18 How do you close the database session after examining the results of an SQL query?
A. Call the ADO.Close function
B. Use the close method for the RecordSet object
C. Set the RecordSet and Connection objects equal to Nothing
D. Use the close method for the RecordSet and Connection objects
19 What are the available trigger event types?
A. Pop-up window, object state, VBScript event
B. Object State, VBScript event, Application crash
C. Pop-up window, object state, test run error, QTP crash
D. Pop-up window, object state, test run error, application crash
20 What is the keyword used to define how the counter variable in a or Next loop increments?
A. ++
B. Next
C. Skip
D. Step
21 What are the two most commonly used ADO objects?
A. Fields
B. Execute
C. Connection, RecordSet
D. Open, ConnectionString
22 How do you declare a constant?

A. Dim statement
B. Con statement
C. Const statement
D. Option Explicit statement
Q: 23 What method is used to retrieve the number of columns in the query results?
A. Fields.Count
B. Fields.Item(EOF)
C. Fields.Count(BOF)
D. Fields.Count.Value
24 To bypass the Object Repository you can:
A. Turn the Object Repository off
B. Use a programmatic description
C. Delete all objects in all repositories
D. Add the object to the Object Repository Manager
25 What does the ChildObjects method return?
A. A Collection object
B. A string true/false
C. A Boolean TRUE/FALSE
D. The number of objects matching the ChildObject description
26 What object is used to read information from a text file?
A. Read
B. ReadLine
C. TextStream
D. File System
E. Open Text File
27 If you are typing in Expert View and you type an object followed by a dot, what does QuickTest
display?
A. Nothing
B. The arguments for that object
C. The methods and properties for that object
D. The child objects and methods for that object
28 By default, how does QuickTest pass arguments to the procedure?
A. ByVal
B. ByRef
C. ByArg
D. ByRes

29 What object is used to send information to test results at the completion of the test run?
A. Result
B. Reporter
C. ReportEvent
D. ResultReport
30 If a procedure is defined in a test script, that procedure is accessible to which tests/scripts?
A. Only to other procedures
B. It is not usable to any test scripts
C. The test script in which it is defined
D. Using the Step Generator, it is available to any test script
31 When does a Do loop statement evaluate for continuation?
A. At the end of the loop
B. At the start of the loop
C. At the start or the end of the loop
D. This loop uses a counter variable
32 How can you retrieve the number of items in the list for a WebList object?
A. GetList
B. GetItem
C. GetItemsCount
D. GetROProperty
33 What is the difference between a subroutine and a function?
A. A subroutine can call itself; a function cannot
B. A function returns a value; a subroutine cannot
C. A function can accept arguments; a subroutine cannot.
D. A subroutine can call other procedures; a function cannot.
34 What method is used to send a run-time Data sheet to an Excel file?
A. Send
B. Export
C. SendSheet
D. Exportsheet
35 What looping statements are available in QuickTest?
A. Whileend, Doloop, Ifhen
B. Switchfase, Ifhen, Fortext
C. Fortext, Whileend, Doloop
D. Fortext, Doloop, Switchase

36 What does the GetTOProperty method do?


A. Retrieves the value of a property from a test object
B. Retrieves the available properties from a test object
C. Retrieves the value of a property from a run-time object
D. Retrieves the available properties from a run-time object
37 To use low-level recording, what must you do first?
A. Start a new test
B. Be in the KeyWord view
C. Be recording in Normal mode
D. Click Low Level Recording under the Automation Menu
38 What is the correct set of add-ins installed automatically with QuickTest 9.2?
A. NET, Web, Java
B. Web, SAP, Visual Basic
C. Active X, Visual Basic, Web
D. Active X, TE, Web Services
39 What information can be seen in the information pane?
A. Syntax errors
B. The test name and author
C. The QTP license information
D. The machine id and operating system
40 What does a breakpoint do?
A. Stops test execution at the specified step, after executing that step
B. Stops test execution at the specified step, before executing that step
C. Pauses test execution at the specified step, after executing that step
D. Pauses test execution at the specified step, before executing that step
41 Which of the following is an example of a missing resource?
A. An object
B. Run Results
C. A Regular Action
D. An External Action
42 What are the available step commands in QuickTest?
A. Step, Step Into, Step Out
B. Step Into, Step Over, Step Out
C. Step Test, Step Action, Step Function
D. Run from Step, Debug from Step, Run from Step

43 When a test is run in update mode, what is updated?


A. The test results
B. The object descriptions
C. The action names in the test
D. The logical names in the test
44 What are the phases in the QuickTest workflow?
A. Plan, Record, Enhance, Run
B. Prepare, Record, Verify, Run
C. Plan, Create, Verify & Enhance
D. Prepare, Create, Verify & Enhance, Integrate
45 Why is low-level recording mode useful?
A. It records exact keyboard operations on an object.
B. It records exact coordinates of all mouse movements.
C. It uses the object repository to determine what methods can be used.
46 What are test object properties?
A. Those properties as defined in a description object.
B. Those properties as defined in Object Identification
C. Those properties displayed by an object at run-time
D. Those properties used in the Object Repository for object identification
47 What is the function of the Object Repository Manager?
A. Assign variable names to test objects
B. View/make/modify a Local Object Repository
C. View/make/modify a Shared Object Repository
D. Define new test objects using programmatic descriptions
48 where are virtual object collections stored?
A. In a Function Library
B. In the local Object Repository
C. In the Object Repository Manager
D. Data folder inside of the QTP installation directory
49 In the Object Identification dialog box, which properties can be viewed?
A. The base filter and optional properties
B. The mandatory and optional properties
C. The base filter and assistive properties
D. The mandatory and assistive properties

50 Where do you turn Smart Identification IN?


A. The Object Repository
B. The Test Settings dialog
C. The General Options dialog
D. The Object Identification dialog
51 How do you know if Smart Identification has been used in a test?
A. The Smart Identification icon appears in the test results
B. The test results will show a run error, causing a test failure
C. The properties used by the object repository will be changed
D. The Object Repository will show the Smart Identification icon
Answer: A
52 What options are available to filter objects in the Target Object Repository pane when merging
object repositories?
A. Show all objects or Show only objects with conflicting object types
B. Show all objects or Show only objects with conflicting descriptions
C. Show only objects with conflicting logical names or Show only objects with conflicting object types
D. Show only objects with conflicting logical names or Show only objects with conflicting descriptions
53 What is the default ordinal identifier?
A. The location
B. The object id
C. The nativeclass
D. The index number
54 Which statement is used to associate a procedure with a test object class?
A. RegisterFunction
B. RegisterUserProc
C. RegisterUserFunc
D. RegisterProcedure
55 What must you do before a shared object repository can be edited?
A. Enable Editing
B. Add a new object
C. Open the object repository
D. Open an action that uses that shared object repository
56 Where do you configure an action to use a shared object repository?
A. Test Settings
B. Action Settings
C. Action Call Properties

D. Associate Repositories
57 You should use local object repositories when you:
A. Work with single-action tests
B. Work with multiple-action tests
C. Create multiple tests for a single application
D. Expect the test object properties to change frequently
58 Where can you merge two shared object repositories?
A. The Object Repository
B. The Object Repository Manager
C. The Associate Object Repositories Tool
D. You can only merge local object repositories
59 If you are typing in Expert View and you type an object followed by a dot, what does QuickTest
display?
A. Nothing
B. The arguments for that object
C. The methods and properties for that object
D. The child objects and methods for that object
60 If you have a Virtual Object Collection stored on your machine, and you don't want to use it, what
must you do?
A. Disable Virtual Object in Test Settings.
B. Remove the Collection from your machine
C. Disable Virtual Objects in General Options.
D. Remove the Collections from the Resources list.
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 3:51 AM 1
comments
Testing Metrics
Metrics used in Software Testing
Metric is a measurement of unit for calculating the Quality of project, process..etc
Metric is calculated using the formula
Below are few of the metrics
Test Coverage = Number of units (KLOC/FP) tested / total size of the system. (LOC represents Lines of
Code)

Number of tests per unit size = Number of test cases per KLOC/FP (LOC represents Lines of Code).
Acceptance criteria tested = Acceptance criteria tested / total acceptance criteria
Defects per size = Defects detected / system size
Test cost (in %) = Cost of testing / total cost *100
Cost to locate defect = Cost of testing / the number of defects located
Achieving Budget = Actual cost of testing / Budgeted cost of testing
Defects detected in testing = Defects detected in testing / total system defects
Defects detected in production = Defects detected in production/system size
Quality of Testing = No of defects found during Testing/(No of defects found during testing + No of
acceptance defects found after delivery) *100
Effectiveness of testing to business = Loss due to problems / total resources processed by the system.
System complaints = Number of third party complaints / number of transactions processed
Scale of Ten = Assessment of testing by giving rating in scale of 1 to 10
Source Code Analysis = Number of source code statements changed / total number of tests.
Effort Productivity = Test Planning Productivity = No of Test cases designed / Actual Effort for Design
and Documentation
Test Execution Productivity = No of Test cycles executed / Actual Effort for testing
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 3:03 AM 0
comments
Monday, November 23, 2009
QC FAQs
1. what are the components in QC

2. How many ways you can report defects in QC

3. How do you map testcases to Requirements in QC


4. How do you create a new field in the QC Templates
5. What are the Fields in Defects
6. How do you connect to QC
7. How to export TCs from Excel to QC
8. How to import defects from QC to Excel
9. How do you create reports and graphs in QC
10. What is TestSet
11. In which section you write TCs in QC
12. How do you convert Requirements into TestPlan
13. what is the purpose of TestLab
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 1:26 AM 1
comments
Intro Selenium
Introduction
Selenium was originally developed by Jason Huggins, who was later joined by other programmers and
testers at ThoughtWorks. It is open source software, released under the Apache 2.0 license and can be
downloaded and used without charge. The latest side project is Selenium Grid, which provides a hub
allowing the running of multiple Selenium tests concurrently on any number of local or remote systems,
thus minimizing test execution time.

Features:
Record and playback
Intelligent field selection will use IDs, names, or XPath as needed
Auto complete for all common Selenium commands

Walk through tests


Debug and set breakpoints
Save tests as HTML, Ruby scripts, or other formats
Support for Selenium user-extensions.js file
Option to automatically assert the title of every page
Automaton Advantages
Automation has specific advantages for improving the long-term efficiency of a software teams testing
processes. Test automation supports:
Frequent regression testing
Rapid feedback to developers during the development process
Virtually unlimited iterations of test case execution
Customized reporting of application defects
Support for Agile and eXtreme development methodologies
Disciplined documentation of test cases
Finding defects missed by manual testing
Introducing Selenium
Selenium is a robust set of tools that supports rapid development of test automation for web-based
applications. Selenium provides a rich set of testing functions specifically geared to the needs of testing
of a web application. These operations are highly flexible, allowing many options for locating UI
elements and comparing expected test results against actual application behavior.
One of Seleniums key features is the support for executing ones tests on multiple browser platforms.
Selenium Components
Selenium is composed of three major tools. Each one has a specific role in aiding the development of
web application test automation.
Selenium-IDE
Selenium-IDE is the Integrated Development Environment for building Selenium test cases. It operates
as a Firefox add-on and provides an easy-to-use interface for developing and running individual test
cases or entire test suites. Selenium-IDE has a recording feature, which will keep account of user actions
as they are performed and store them as a reusable script to play back. It also has a context menu (rightclick) integrated with the Firefox browser, which allows the user to pick from a list of assertions and
verifications for the selected location. Selenium-IDE also offers full editing of test cases for more
precision and control.

Although Selenium-IDE is a Firefox only add-on, tests created in it can also be run against other browsers
by using Selenium-RC and specifying the name of the test suite on the command line.
Selenium-RC (Remote Control)
Selenium-RC allows the test automation developer to use a programming language for maximum
flexibility and extensibility in developing test logic. For instance, if the application under test returns a
result set, and if the automated test program needs to run tests on each element in the result set, the
programming languages iteration support can be used to iterate through the result set, calling Selenium
commands to run tests on each item.
Selenium-RC provides an API (Application Programming Interface) and library for each of its supported
languages: HTML, Java, C#, Perl, PHP, Python, and Ruby. This ability to use Selenium-RC with a high-level
programming language to develop test cases also allows the automated testing to be integrated with a
projects automated build environment.
Selenium-Grid
Selenium-Grid allows the Selenium-RC solution to scale for large test suites or test suites that must be
run in multiple environments. With Selenium-Grid multiple instances of Selenium-RC are running on
various operating system and browser configurations, each of these when launching register with a hub.
When tests are sent to the hub they are then redirected to an available Selenium-RC, which will launch
the browser and run the test. This allows for running tests in parallel, with the entire test suite
theoretically taking only as long to run as the longest individual test.

* Tests developed on Firefox via Selenium-IDE can be executed on any other supported browser via a
simple Selenium-RC command line.
** Selenium-RC server can start any executable, but depending on browser security settings, there may
be technical limitations that would limit certain features.
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 1:21 AM 0
comments
Thursday, November 19, 2009
Defect /Bug Life Cycle
Defect / Bug
A computer bug is an error, flaw, mistake, failure, or fault in a computer program that prevents it from
working correctly or produces an incorrect result. Bugs arise from mistakes and errors, made by people,
in either a programs source code or its design.

Defect / Bug / Incident / Issue: The meaning for these words is same; any functionality not working as
per requirements.
Error: Any mistake in the program is an error; the error can be caused because of Syntax / Logical Error /
Runtime Error.
Failure: If the application / software is not satisfying the customer need it is failure product.
Life cycle of Bug:
Report New Defect: When any functionality is not working as per requirement the tester can report a
defect to developers

The Defect Report has the fields like DefectID, Summary, Detected By, Date Found, Assigned To,
Severity, Module, Build Ver, Priority, Status, Reproducible, Fixed By, Environment, Expected Result,
Actual Result, Comments

Defect Life Cycle

Bug status description:

Following are various stages of bug life cycle. The status caption may vary depending on the bug tracking
system you are using.
1) New: When a Tester files new Defect.
2) Deferred / Postponed: If the bug is not related to current build or can not be fixed in this release or
bug is not important to fix immediately then the project manager can set the bug status as deferred
3) Resolved/Fixed: When developer makes necessary code changes and verifies the changes then
he/she can make bug status as Fixed and the bug is passed to testing team.
4) Could not reproduce: If developer is not able to reproduce the bug by the steps given in bug report
by QA then developer can mark the bug as CNR. QA needs action to check if bug is reproduced and can
assign to developer with detailed reproducing steps.
5) Need more information: If developer is not clear about the bug reproduce steps provided by QA to
reproduce the bug, then he/she can mark it as Need more information. In this case QA needs to add
detailed reproducing steps and assign bug back to dev for fix.
6) Rejected/Invalid: Some times developer or team lead can mark the bug as Rejected or invalid if the
system is working according to specifications and bug is just due to some misinterpretation.
7) Reopen: If QA is not satisfy with the fix and if bug is still reproducible even after fix then QA can mark
it as Reopen so that developer can take appropriate action.
8) Closed: If bug is verified by the QA team and if the fix is ok and problem is solved then QA can mark
bug as Closed.
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 4:05 AM 0
comments

Tuesday, November 17, 2009


EXCEL Write into procted file
'''Script to create a new excel file , write data
'''save the file with read and write protected
'''''pwd1 is for read protected pwd2 is for write protected
Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Add
xl.DisplayAlerts=False
Set ws=wb.Worksheets("sheet1")
ws.cells(1,1)=100
ws.cells(1,2)=200
wb.Saveas "e:\data2.xls",,"pwd1","pwd2"
wb.Close
Set xl=nothing

'''Script to open excel file ,which is read and write protected write data
'''''pwd1 is for read protected pwd2 is for write protected
Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Open("e:\data2.xls",0,False,5,"pwd1","pwd2")
xl.DisplayAlerts=False
Set ws=wb.Worksheets("sheet1")
ws.cells(1,2)="hello"
ws.cells(2,2)="new data"
wb.Save
wb.Close
Set xl=nothing
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 1:56 AM 0
comments
Monday, November 16, 2009
Automation Plan
Below are the contents of Automation Test Plan
Content

Introduction
In Scope for Automation
Out of Scope
Automation Approach
Assumptions
Automation Tool
Framework
Schedules
Deliverables
Risks & Mitigation Plan
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 1:36 AM 0
comments
Sunday, November 15, 2009
Manual FAQs
What are the phases in SDLC
What are the Testing methodologies ( whitebox, blackbox, graybox)
What is Difference between SDLC and STLC
What is usecase.
What is project and product Testing
What is Verification and validation
What is traceability Matrix.
What is stub and Driver and in which approach these are used.
What are the types of testing for webapplication testing.
What is unit testing / Component testing
What is System Testing
what is Entry and Exit criteria
What are the test delivarables
what is Test Data
What are the fields in the TestCase
what is functional and non functional testing
what is static and dynamic testing
How to perform sanity testing
what is retesting and regresssion testing
what is exploratory testing
what is load and stress testing
what is soak testing
what is memory leakage testing
How do you test cookies

what is session testing


what is defect , bug, error , failure
what is defect life cycle
what is defect leakage
Give any example for high severity and low priority
what are the different status of a defect
if developer reject a defect what you will do
if less time is given for testing, what is your testing approach
How do you report defects
what is release notes
How do you setup test environment
Testing is conducted in which environment
what is I18N Testing
What is ECP and BVA Testing
What are the fields in Defect Report
what are your responsibilities in a project
As a lead / QA tester what are the challenges you have faced
If requirements are freqently changing what you do
what is the testing approach you are following
how do you prepare testcases
suppose if requirements are not clear how do you prepare testcases
if requirements are not clear how do you write testcases
what is the approach you follow do design testcases
what is scenario
if you find a severe defect in the last phase of testing ; before release what you do
what is pareto chart ( 80:20 priniciple)
what is oracle
what is cause effective graph
what is TestEfficiency
what is Defect Density
what is metric
what is the testing process followed in your company
what is scrum model
what is sprint
what is agile testing
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 7:18 AM 4
comments
Friday, November 13, 2009

STLC
STLC
Software Testing Life Cycle has the below phases in execution of Testing a project
Analysis & Planning
During this phase Analyze the project testing is manual / Automation testing, Identify the budget,
Resource required, Types of Testing Required. Also discuss with Business Analyst, Project manager,
Business users and understand the Development Schedule, Project Build Release dates, Project Release
dates. Forming the Testing Team.
In this phase Test Lead / Manager has to decide what are in scope for testing, Estimations, Budge,
Schedules, Type of Testing to be conducted, Identify the deliverables, Approach.
During this phase preparation of high level test plan- is designed to prescribe the scope, approach,
resources, and schedule of all testing activities. The plan must identify the items to be tested, Items not
to be tested, the types of testing to be performed, the team responsible for testing, the resources and
schedule required to complete testing, and the risks associated with the plan.). All the above details are
included in the STP.
Test Design
After Test Plan is prepared / During the Plan KT sessions are also conducted to the Testing Team
members to understand the Project Requirements / Functionalities. After understanding the
Requirements Test Cases were developed for Functional testing / System Testing. The Test Case should
have the Details like TestCaseID, Priority, Test Name, Steps, Description, Expected Results, Actual Results
and Status
Test Cases are designed for
Sanity Test Cases
Functional Test Cases
Regression Test Cases
Negative Test Cases
It the project is Automation Test Scripts are developed for the existing Test Cases /Functionalities
Test Execution
The application is validated for the Test cases and check the application is working as per Requirements.
To execute the application Test Setup is prepared with the required Environment and the application is
tested with Different Test Data.
Reporting & Tracking
Report any Defects to the Development team if any functionality is not working as per the
Requirements.
The defect Report should have details
Defect ID, Summary, Detected By, Date, Assigned To, Severity, Priority, Status, Module, Build Ver,
Environment, Reproducible, Expected, Actual, Comments
Test Closure
After Testing is completed plan for Test Closure based on if no new defects are found, No risk in the
project, all the functionalities are tested and all the defects are closed

General Testing Process in the Company


Whenever we get a new project for Testing we have a initial Project meetings are conducted to get the
familiarity of the project and also to understand the details like about the project, scope, is it manual
testing / Automation is required? Who are the Development Team, Who is Testing Team, how many
resource are required and available, who project manager, about Client, The Technology of the project is
like is the project is developed in Java / .Netetc
Initially for the Team members / Test Lead KT sessions are conducted by the Sr. Resource of the project
so that the team can understand about the Project, The Testing Team also can go through the SRS/
FRSetc or if already developed applications go through the application and understand the project
functionality
Based on the Project Requirements Test Plan is prepared as specified in the STLC.
Once the plan is prepared, the Scenarios are derived from the functionalities
For the Scenarios Test Cases are prepared
After the Test Cases are prepared Reviews are conducted to ensure the Test Cases are correct
During this phase as per the planned schedule when the build is released by the Developers Testing is
conducted in the Test Environment to ensure the application is working if the application is not working
Defects are posted to the developers
Responsibility of a QA Tester
Understand the Project Requirements
Review of the Requirements / Test Requirement Specification (TRS)
Prepare the Scenarios
Design the Test Cases (specified in the above STLC Section)
Validate the application to ensure the application is working as per the req.
Report the Defects to the Development Team and Track the defects.
Ensure the Product / Project satisfies the Standards
Communication with the Business users, Developers
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 1:53 AM 3
comments
SDLC
SDLC (Software Development Life Cycle)
The following phases Describes the Project Development process.
Project Initiation/planning
During this phase generate a high-level view of the intended project and determine the goals of the
project.
The feasibility study is sometimes used to present the project to management in an attempt to gain
funding / Budget for the project.
Projects are typically evaluated in three areas of feasibility: economical, operational, and technical.
Analysis / Requirement Gathering

During this phase Project Manager / Business Analyst should be responsible to discuss with the Stake
Holders (Business users) and find out the requirements for the project
Following are the Different Categories of Requirements
Customer Requirements
Functional Requirements
Non-functional Requirements
Performance Requirements
Design Requirements
Derived Requirements
Allocated Requirements
Design
In systems design functions and operations are described in detail, including screen layouts, business
rules, process diagrams and other documentation. The output of this stage will describe the new system
as a collection of modules or subsystems.
The design stage takes as its initial input the requirements identified in the approved requirements
document. For each requirement, a set of one or more design elements will be produced as a result of
interviews, workshops, and/or prototype efforts. Design elements describe the desired software
features in detail, and generally include functional hierarchy diagrams, screen layout diagrams, tables of
business rules, business process diagrams, pseudocode, and a complete entity-relationship diagram with
a full data dictionary. These design elements are intended to describe the software in sufficient detail
that skilled programmers may develop the software with minimal additional input.
Build or coding
Modular and subsystem programming code will be accomplished during this stage. Unit testing and
module testing are done in this stage by the developers. This stage is intermingled with the next in that
individual modules will need testing before integration to the main project. Code will be test in every
section.
Testing
The code is tested at various levels in software testing. Unit, system and user acceptance testing are
often performed. This is a grey area as many different opinions exist as to what the stages of testing are
and how much if any iteration occurs. Iteration is not generally part of the waterfall model, but usually
some occurs at this stage.
Types of testing:
Data set testing.
Unit testing
System testing
Integration testing
Black box testing
White box testing
Module testing
Regression testing
Automation testing

User acceptance testing


Performance testing
Release and maintenance
The deployment of the system includes changes and enhancements before the decommissioning or
sunset of the system. Maintaining the system is an important aspect of SDLC. As key personnel change
positions in the organization, new changes will be implemented, which will require system updates.
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 12:17 AM 0
comments
Tuesday, November 10, 2009
QTP FAQs
1. What is the exe of QTP (QTPro.exe)
2. What is the extension of Script file (.mts)
3. What is the extension of Library file (.vbs)
4. what is the extension of Repository files ( .bdb & .tsr)
5. What is the extension of Recovery file ( .qrs)
6. What are the types of recording?
7. What are the types of run modes?
8. What is the difference between reusable action and Function?
9. How QTP can recognize the objects in the application
10. What is the difference between GetToProperty and GetROProperty?
11. What is Test Object and Runtime Object
12. What is Datatable used for
13. What are the different frameworks in QTP?
14. Can you write script to login into yahoo website?
15. What is descriptive coding?
16. What are the different types of recovery scenarios in QTP?
17. What is different between Call to Existing action and Call to Copy Action?
18. What is Action0?
19. What is expert view and keyword view?
20. Can you write a function to accept 2 numbers and return a value?
21. What is error handling in QTP?
22. What is difference between Global sheet and Local Sheet?
23. Write few methods of DataTable
24. What is the use of Environment Variables?
25. What are the types of Environment Variables?
26. How do you load environment variables during runtime?
27. What is the difference between bitmap checkpoint and image checkpoint?
28. How do you connect to database from QTP?
29. When the data is selected from Database, the data is stored in which object

30. What is description object?


31. Write script to count the number of links in a webpage
32. Write few methods of webtable
33. What is the method to count the number of values in a weblist?
34. How to set a value in a textbox.
35. What is the return value for split, getROproperty, len, mid functions?
36. What is the syntax to connect to Database (SQL SERVER?)
37. When data is retrieved from Database, where is the data stored?
38. If we dont want to execute any action what to do?
39. When any error is raised in the Script, the details of error is stored in which object.
40. How to get the list of count of values from WebList
41. What is the use of SetTOProperty?
42. If more than 1 object in the window has same description properties what mechanism is used by the
tool to differentiate the objects?
43. If object properties are changed during runtime what mechanism the tool can use to recognize the
object
44. How to load Object Repository during runtime
45. How to load environment variables from a file during runtime.
46. What is the use of waitproperty
47. How to specify the datatable iterations for a local datasheet.
48. What does the Sync method for a webpage will do?
49. What is the default synchronization timeout for an object?
50. What is step into, step over, step out will do
51. What is a variable, watch, execute in Debug Viewer.
52. How QTP does identifies the object in the application.
53. What type of problems one will face with QTP, if too many browsers are opened at a time?
54. How to make arguments optional in a function?
55. can u store QTP frame work folders in VSS? If Not where u store those?
56. What is purpose of automation?
57. How good are you in writing VBscript code for your application? Can you completely
58. write VBscrit for your project with out using recording mode in QTP?
59. How to load the object repository at run time?
60.What is the framework followed by ur company in qtp.
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 8:20 PM 1
comments
Monday, November 9, 2009
S/W Testing Types
Software Testing Types:
White box testing:

This testing is conducted based on knowledge of the internal logic of an applications code. This is also
known as Glass box Testing / Open Box Testing / Clear Box Testing. The testers should know the internal
code of the application. Tests are based on coverage of code statements, branches, paths, conditions.
Unit testing:
Testing is conducted on individual components or modules. This test is conducted by the Developers or
whiterbox testers,as this requires detailed knowledge of the internal program design and code.
Integration testing:
Testing is conducted by 2 or more modules / systems to verify combined functionality after integration.
Modules are typically code modules, individual applications, client and server applications on a network,
etc. This type of testing is especially relevant to client/server and distributed systems.
Incremental integration testing:
Testing is conducted in Bottom up approach; continuous testing of an application as new functionalities
are added; Application functionalities and modules should be independent enough to test separately.
Black box testing:
Testing the application without not considered about the internal design of the system.Testing is
conducted based on requirements and functionality.
Functional testing:
This type of testing is conducted to ensure the application is working as per the business requirements
and the internal logic of the code is ignored.This type of test is conducted as part of blackbox testing
System testing:
The Entire system is tested as per the Business requirements. Black-box type testing that is based on
complete requirement specifications, covers all combined parts of a system.
End-to-end testing:
Similar to system testing,testing is conducted on the complete application environment in a situation
that resembles like application used in production, such as interacting with a database, using network
communications, or interacting with other hardware, applications, or systems if appropriate.
Sanity testing:
Testing to determine if the new build is stable, all the major functionalities are working correct. usually
conducted as First test when ever the build is released. During this test all the major functionalities are
tested.if any major functionality fails and if showstopper the testing is stoped and reported to
development as serious issue.
Regression testing:
Testing the application as a whole for the changes done in the application. Test is conducted to ensure

the changes are working correct and because of these changes unchanged code is not affected.
ReTesting:
The the application functionality once again with different type of input data to validate the
functionalities as per the requirements.
Acceptance testing:
This type of testing is done to verify the system meets the customer specified requirements. Business
Users or customer do this testing to determine whether to accept application.
Performance testing:
Test is conducted the check the peformance of the system to complete the transaction, performance of
the system can the checked by conducting Load, Stress, Volume,Soak testing..
Load testing:
It is a performance testing to check system behavior under load.This test is conducted by increasing the
load on the system and check the performance.
Stress testing:
System is stressed beyond its specifications to check how and when it fails. Performed under heavy load
like putting large number beyond storage capacity, complex database queries, continuous input to
system or database load.
Volume Testing:
This test is conducted by increasing the volume of data for processing and check the Performance.
soak Testing:
check the performance of the application by continiously accessing the application for more number of
hours.
Usability testing:
This is to check the User-friendliness of the application. The flow of the application is tested and check
new user can understand the application easily, Proper help documented are provided. The application
is easy to use, look and feel and navigations are simple to understand..etc
Concurrent Testing:
Check the behaviour of the application when multiple users access the same functionality of the
application at the same time.
Exploratory Testing:
This testing is an approach to software testing that is concisely described as simultaneous learning, test
design and test execution.Exploratory testing has always been performed by skilled testers.Exploratory

testing is particularly suitable if requirements and specifications are incomplete, or if there is lack of
time. The approach can also be used to verify that previous testing has found the most important
defects. It is common to perform a combination of exploratory and scripted testing where the choice is
based on risk
Adhoc Testing:
Ad hoc testing is a commonly used term for software testing performed without planning and
documentation.The tests are intended to be run only once, unless a defect is discovered. Ad hoc testing
is a part of exploratory testing, being the least formal of test methods
Install/uninstall testing:
This test is conducted for full, partial, or upgrade install/uninstall processes on different operating
systems under different hardware, software environment.This test is conducted to ensure after install
/uninstall of the application the existing sytem is not affected like performance, affecting other
softwares..etc
Recovery testing:
check wheather the system can recover the data from failures.Security testing Can system be
penetrated by any hacking way. Testing how well the system protects against unauthorized internal or
external access. Checked if system, database is safe from external attacks.
Compatibility testing:
Testing is conducted to check the application works on different platforms / different browsers /
different versions of browser (for web application). Test is also conducted to check the backward and
forward comaptibility
Alpha testing:
In house Testing environment is created for this type of testing. Testing is done at the end of
development by the Business users. Still minor design changes may be made as a result of testing status.
Beta testing :
Testing typically done by end-users or others. Final testing before releasing application for commercial
purpose.
I18N Testing:
Testing the application for different international languages, check the application testing is successfull
for the following items

help information

help search information

images

code templates

flat text files

font names and sizes

date, time, and number formatting

collation

examples

Localization Testing
Localization is the process of adapting a globalized application to a
particular culture/locale. The following needs to be considered in localization testing:

Things that are often altered during localization, such as the UserInterface and content files.

Operating System

Keyboards

Text Filters

Hot keys

Spelling Rules

Sorting Rules

Upper and Lower case conversions

Printers

Size of Papers

Mouse

Date formats

Rulers and Measurements

Memory Availability

Voice

User Interface language/accent

Video Content

Monday, November 9, 2009


Test Cases
1. Check whether Pen Writes or not2. Check How it Writes3. Compatibility of pen with different kind of
papers and refils4. Verify the leakage near tip.5. Verify the grip of cap.6. Verify the tip is visible during
writting.7. Look and feel of pen8. Relibility testing
===========================================
TestCases for ATM Machine
==========================================
1. successful card insertion.2. unsuccessful operation due to wrong angle card insertion.3. unsuccessful
operation due to invalid account card.4. successful entry of pin number.5. unsuccessful operation due to
wrong pin number entered 3 times.6. successful selection of language. 7. successful selection of account
type.8. successful selection of withdrawal option.9. successful selection of amount.10. unsuccessful
operation due to wrong denominations.11. successful withdrawal operation.12. unsuccessful
withdrawal operation due to amount greater than possible balance.13. unsuccessful due to lack of
amount in ATM.14. unsuccessful due to amount greater than the day limit.15. unsuccessful due to
server down.16. unsuccessful due to click cancel after insert card.17. unsuccessful due to click cancel
after insert card and pin no.18. unsuccessful due to click cancel after language selection,account type
selection,withdrawal selection, enter amount
============================================
TestCases for Yahoo messenger
============================================
1. verify to login2. verify to add contact is working3. send a message to contact available online and
offline4. send a file 5. add an existing contact6. verify the settings7. verify the contacts available online
and and available(offline)8. verify to delete contact9. verify to add group
==========================================
TestCases for Telephone
==========================================
1.Lift the handset, u should get a tone.2.Dial the number again u should here the dial tones3.If the
number is busy, in active, or any such issues you should get an alert about the same4.If no such alerts ,
you should here riging tone in the hand set.5.If it rings for a long time n destination doesnt picks up the
call, an alert should be given.6.If not the above case, at destination user must lift the phone.7.When he
lifts the phone ringing tone must be ended.8.Now talking session must take place.9.Both src and

destination user can talk n hear properly.10.If any one of them closes the session, again a tone must be
heard at the other end.11.Close of session in between
=========================================
TestCases for Coffee Vending machine
========================================
check the vending machine has options to select coffee, tea, milkcheck insert coin is workingcheck after
insert coin only coffee / tea / milk can be takencheck if invalid coin is inserted will not workcheck if extra
amount is inserted balance is returnedinsert coinpress coffee buttonin the middle switch off the
machinecheck weather the coffee comes or not.
insert coinpress coffee buttonwhile coffee is pouring downpress other flavour buttoncheck wheather
you get the same flavour selected first or the flavour selected second.
=========================================
Testcase for mobile phone
=========================================
1.Check whether the dimensions of mobile are according to the requirements.2.Check whether the
colour is accroding to requirments.3.Check whether the functionalities are with respect to the
requirements.4.Check whether the backup for battery is as given in the manual.5.Check whether the
functionalities are with respect to the manual.(extras,games,email services,bluetooth,camera
etc.)6.Checking for various items as charger,headphones,cable etc.7.checking for display colour(B/w or
colour) of the mobile as mentioned in requirements.8.check whether the functionality of keys are
proper.9.check whether the model is according to the requirements.10.check for memory used for
storage.11.checking out for memory where data is stored above the peak value.12.checking for proper
signal and network in maximum areas.13.checking for performance of the mobile.14.checking for the
usability.
==========================================
TestCases for login Functionality of any application
==========================================
1. login with valid username and password2. login without username3. login without password4. login
with invalid username5. login wiht invalid password
==========================================

Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 12:38 AM 1


comments
Sunday, November 8, 2009
VBScripts-2
'''Script to get the list of links in Google and do spell check
===============================================================
dim d
set mw=CreateObject("Word.Application")
set d=Description.Create
d("micclass").value="Link"
set a=Browser("Google").page("Google").childobjects(d)
for i=0 to a.count-1
mw.WordBasic.filenew
s=a(i).getROProperty("innertext")
mw.WordBasic.insert s
if mw.ActiveDocument.Spellingerrors.count>0 then
Reporter.ReportEvent 1,"Spelling","spelling error :"&s
end if
mw.ActiveDocument.Close(False)
next
mw.quit
set mw=nothing
=========================================
''''Script to check ON the checkboxes in yahoo mail inbox
=========================================
Dim d
Set d=Description.Create
d("micclass").value="WebCheckBox"
Set c=Browser("Inbox (17) - Yahoo! Mail").Page("Inbox (17) - Yahoo! Mail").ChildObjects(d)
For i=1 to 10
c(i).set "ON"
Next
========================================
'''script to select a mail having subject 'hi' or 'HI'
========================================
n=Browser("yahoo").Page("yahoo").WebTable("Inbox").RowCount
For i=2 to n
s=Browser("yahoo").Page("yahoo").WebTable("Inbox").GetCellData(i,7)
If lcase(trim(s))="hi" Then
Browser("yahoo").Page("yahoo").WebCheckBox("index:="&i-1).set "ON"

End If
Next
========================================
'''''Function to send a mail
========================================
Function SendMail(SendTo, Subject, Body, Attachment)
Set otl=CreateObject("Outlook.Application")
Set m=otl.CreateItem(0)
m.to=SendTo
m.Subject=Subject
m.Body=Body
If (Attachment <> "") Then
Mail.Attachments.Add(Attachment)
End If
m.Send
otl.Quit
Set m = Nothing
Set otl = Nothing
End Function
Call SendMail("venkatadrin.g@gmail.com","hi","This is test mail for tsting","")
================================================
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 8:05 PM 0
comments
WSH
Windows Script Host (WSH) is a Windows administration tool.
WSH creates an environment for hosting scripts. That is, when a script arrives at your computer, WSH
plays the part of the host it makes objects and services available for the script and provides a set of
guidelines within which the script is executed. Among other things, Windows Script Host manages
security and invokes the appropriate script engine.
WSH is language-independent for WSH-compliant scripting engines. It brings simple, powerful, and
flexible scripting to the Windows platform, allowing you to run scripts from both the Windows desktop
and the command prompt.
Windows Script Host is ideal for noninteractive scripting needs, such as logon scripting, administrative
scripting, and machine automation.
WSH Objects and Services
Windows Script Host provides several objects for direct manipulation of script execution, as well as
helper functions for other actions. Using these objects and services, you can accomplish tasks such as

the following:
Print messages to the screen

Run basic functions such as CreateObject and GetObject

Map network drives

Connect to printers

Retrieve and modify environment variables

Modify registry keys

Wscript :

Set and retrieve command line arguments

Determine the name of the script file

Determine the host file name (wscript.exe or cscript.exe)

Determine the host version information

Create, connect to, and disconnect from COM objects

Sink events

Stop a script's execution programmatically

Output information to the default output device (for example, a dialog box or the command
line)

WshArguments

Access the entire set of command-line arguments

WshNamed

Access the set of named command-line arguments

WshUnnamed

Access the set of unnamed command-line arguments

WshNetwork

Connect to and disconnect from network shares and network printers

Map and unmap network shares

Access information about the currently logged-on user

WshController

Create a remote script process using the Controller method CreateScript()

WshRemote

Remotely administer computer systems on a computer network

Programmatically manipulate other programs/scripts

WshRemote

Error Access the error information available when a remote script (a WshRemote object)
terminates as a result of a script error

WshShell

Run a program locally

Manipulate the contents of the registry

Create a shortcut

Access a system folder Manipulate environment variables (such as WINDIR, PATH, or PROMPT)

WshShortcut

Programmatically create a shortcut

WshSpecialfolders

Access any of the Windows Special Folders

WshURLShortcut

Programmatically create a shortcut to an Internet resource

WshEnvironment

Access any of the environment variables (such as WINDIR, PATH, or PROMPT) WshScriptExec

Determine status and error information about a script run with Exec()

Access the StdIn, StdOut, and StdErr channels

''''''Display the username, domain, computername

===============================================
Set obj=CreateObject("WScript.NetWork")
str="User Name is " & obj.UserName str=str&"Computer Name is " &
obj.ComputerNamestr=str&"Domain Name is " & obj.UserDomainMsgBox strSet obj=Nothing
==============================================='
'''''Run notepad.exe and send ALT+F4 key which will close nodepad
Set obj=CreateObject("WScript.Shell")
obj.Run "notepad.exe"
wait(5)
obj.SendKeys "%{F4}"
==============================================
set ws = CreateObject("WScript.Shell")
ws.Run "calc"
wait(2)
ws.SendKeys "1{+}"
wait(2)
ws.SendKeys "2"
wait(2)
ws.SendKeys "~"
wait(2)
ws.SendKeys "*3"
wait(2)
ws.SendKeys "~"
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 12:43 AM 0
comments
Saturday, November 7, 2009
WMI

Purpose
Windows Management Instrumentation (WMI) is the infrastructure for management data and
operations on Windows-based operating
systems. we can write WMI scripts or applications to automate administrative tasks on remote
computers and WMI also supplies
management data to other parts of the operating system and products.
Starting WMI Service
WMI runs as a service with the display name "Windows Management Instrumentation" and the service
name "winmgmt". WMI runs
automatically at system startup under the LocalSystem account. If WMI is not running, it automatically
starts when the first
management application or script requests connection to a WMI namespace.
======================================================
''''''Display the list of namespaces in WMI service
======================================================
strComputer = "."
Set ms = GetObject("winmgmts:\\" & strComputer & "\root")
Set ns=ms.InstancesOf("__NAMESPACE")
For Each n In ns
print n.Name
Next
================================================='
''Display the list of classes in cimv2 names space
=================================================
strComputer = "."
Set ms =GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set clss = ms.SubclassesOf()
For Each c In clss
print c.Path_.PathNext
================================================
The Win32_Process class defines the following methods.
AttachDebugger : Launches the currently registered debugger for a process.
Create : Creates a new process.
GetOwner : Retrieves the user name and domain name under which the process is running.
GetOwnerSid : Retrieves the security identifier (SID) for the owner of a process.
SetPriority : Changes the execution priority of a process.
Terminate : Terminates a process and all of its threads.
=============================================
''''''''Create a notepad application
=============================================
strComputer = "."

Set ms = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")


Set p = ms.get("Win32_Process")
p.create "notepad.exe"
=============================================
'''''''Terminate all the instances of notepad.exe running in the system
=============================================
strComputer = "."
Set wms =GetObject("winmgmts:\\" & strComputer&"\root\cimv2")
Set citems=wms.ExecQuery("Select * from Win32_process where Name='notepad.exe' ")
For each p in citems
p.Terminate
Next
==============================================
The Win32_product class defines the following methods.
Install : Installs an associated Win32_Product instance using the installation package provided through
PackageLocation and
any command line options that are supplied.
Admin : Performs an administrative install of an associated Win32_Product instance using the
installation package provided
through PackageLocation, and any command line options that are supplied.
Advertise : Advertises an associated Win32_Product instance using the installation package provided
through PackageLocation
and any command line options that are supplied.
Reinstall : Reinstalls the associated instance of Win32_Product using the specified reinstallation mode.
Upgrade : Upgrades the associated Win32_Product instance using the upgrade package provided
through PackageLocation and any
command line options that are supplied.
Configure : Configures the associated instance of Win32_Product to the specified install state and level.
Uninstall : Uninstalls the associated instance of Win32_Product.
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 5:21 AM 0
comments
Adv VBScripts
'''''''''''''''create a new text file
=====================================================
Dim fs,f
Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.CreateTextFile("e:\file1.txt")
f.WriteLine "hello"
f.WriteLine "this is sample data"
f.Close

Set fs=nothing
=====================================================
'''''''''''''''read data from a text file
=====================================================
Dim fs,f
Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile("e:\file1.txt",1)
While f.AtEndOfLine<>True
msgbox f.ReadLine
Wend
f.Close
Set fs=nothing
=====================================================
''''''''''create a new excel file and write data
=====================================================
Dim xl,wb,ws
Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Add
Set ws=wb.Worksheets("sheet1")
ws.cells(1,1)=10
ws.cells(2,1)=20
ws.cells(3,1)=50
wb.SaveAs "e:\file1.xls"
wb.Close
Set xl=nothing
=====================================================
'''''''open existing file and write data in second column in Sheet1
=====================================================
Dim xl,wb,ws
Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Open("e:\file1.xls")
Set ws=wb.Worksheets("sheet1")
ws.cells(1,2)="mindq"
ws.cells(2,2)="hyd"
ws.cells(3,2)="ap"
wb.Save
wb.Close
Set xl=nothing
=====================================================
'''''''''''read data from excel from rows and columns
=====================================================
Dim xl,wb,ws

Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Open("e:\file1.xls")
Set ws=wb.Worksheets("sheet1")
r=ws.usedrange.rows.count
c=ws.usedrange.columns.count
For i=1 to r
v=""
For j=1 to c
v=v&" "& ws.cells(i,j)
Next
print v
print "-----------------------"
Next
wb.Close
Set xl=nothing
======================================================
''''''''''''''''get the bgcolor in a cell in excel
======================================================
Dim xl,wb,ws
Set xl=CreateObject("Excel.Application")
Set wb=xl.Workbooks.Open("e:\file3.xls")
Set ws=wb.Worksheets("sheet1")
r=ws.usedrange.rows.count
c=ws.usedrange.columns.count
For i=1 to r
For j=1 to c
x=ws.cells(i,j).interior.colorindex
msgbox x
Next
Next
wb.Close
Set xl=nothing
======================================================='
'''''''''''''''''''''create word and write data
=======================================================
dim mw
set mw=CreateObject("Word.Application")
mw.Documents.Add
mw.selection.typetext "hello"
mw.ActiveDocument.SaveAs "e:\file1.doc"
mw.quit
set mw=nothing

=======================================================
''''''''''script will display all the doc files in all the drives in the system
========================================================
Dim mw
Set mw=CreateObject("Word.Application")
Set fs=createobject("Scripting.FileSystemObject")
Set d=fs.Drives
mw.FileSearch.FileName="*.doc"
For each dr in d
msgbox dr
mw.FileSearch.LookIn=dr
mw.FileSearch.SearchSubFolders=True
mw.FileSearch.Execute
For each i in mw.FileSearch.FoundFiles
print i
Set f=fs.GetFile(i)
print f.Name&" "&f.Size&" "&f.DateCreated
print "-------------------------------------------------------------------"
Next
Next
mw.Quit
==========================================================
'''''''''Open Internet Explorer and navigate to yahoomail
==========================================================
Dim ie
Set ie=CreateObject("InternetExplorer.Application")
ie.Visible=True
ie.Navigate "www.yahoomail.com"
x=Browser("CreationTime:=0").GetROProperty("title")
msgbox x
==========================================================
''''''Create word, Create table and write all the services names
==========================================================
Set mw = CreateObject("Word.Application")
mw.Visible = True
Set dc = mw.Documents.Add()
Set objRange = dc.Range()
dc.Tables.Add
objRange,1,3
Set objTable = dc.Tables(1)
x=1
strComputer = "."

Set wms=GetObject("winmgmts:\\" & strComputer & "\root\cimv2")


Set colItems = wms.ExecQuery("Select * from Win32_Service")
For Each s in colItems
If x > 1 Then
objTable.Rows.Add()
End If
objTable.Cell(x, 1).Range.Font.Bold = True
objTable.Cell(x, 1).Range.Text = s.Name
objTable.Cell(x, 2).Range.text = s.DisplayName
objTable.Cell(x, 3).Range.text = s.State
x=x+1
Next
===========================================================
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 3:54 AM 0
comments
Friday, November 6, 2009
UNIX Commands
UNIX Tutorial for Beginners
History of UNIX
UNIX was originally developed at Bell Laboratories as a private research project by a small group of
people. Read all about the history of its creation.
Typographical conventions
In what follows, we shall use the following typographical conventions:
Characters written in bold typewriter font are commands to be typed into the computer as they stand.
Characters written in italic typewriter font indicate non-specific file or directory names.
Words inserted within square brackets [Ctrl] indicate keys to be pressed.
So, for example,
% ls anydirectory [Enter]
means "at the UNIX prompt %, type ls followed by the name of some directory, then press the key
marked Enter"
Don't forget to press the [Enter] key: commands are not sent to the computer until this is done.
Note: UNIX is case-sensitve, so LS is not the same as ls. The same applies to filenames, so myfile.txt,
MyFile.txt and MYFILE.TXT are three seperate files. Beware if copying files to a PC, since DOS and
Windows do not make this distinction.
UNIX Introduction
This session concerns UNIX, which is a common operating system. By operating system, we mean the
suite of programs which make the computer work. UNIX is used by the workstations and multi-user
servers within the school.
On X terminals and the workstations, X Windows provide a graphical interface between the user and

UNIX. However, knowledge of UNIX is required for operations which aren't covered by a graphical
program, or for when there is no X windows system, for example, in a telnet session.
The UNIX operating system
The UNIX operating system is made up of three parts; the kernel, the shell and the programs.
The kernel
The kernel of UNIX is the hub of the operating system: it allocates time and memory to programs and
handles the filestore and communications in response to system calls.
As an illustration of the way that the shell and the kernel work together, suppose a user types rm myfile
(which has the effect of removing the file myfile). The shell searches the filestore for the file containing
the program rm, and then requests the kernel, through system calls, to execute the program rm on
myfile. When the process rm myfile has finished running, the shell then returns the UNIX prompt % to
the user, indicating that it is waiting for further commands.
The shell
The shell acts as an interface between the user and the kernel. When a user logs in, the login program
checks the username and password, and then starts another program called the shell. The shell is a
command line interpreter (CLI). It interprets the commands the user types in and arranges for them to
be carried out. The commands are themselves programs: when they terminate, the shell gives the user
another prompt (% on our systems).
The adept user can customise his/her own shell, and users can use different shells on the same machine.
Staff and students in the school have the tcsh shell by default.
The tcsh shell has certain features to help the user inputting commands.
Filename Completion - By typing part of the name of a command, filename or directory and pressing the
[Tab] key, the tcsh shell will complete the rest of the name automatically. If the shell finds more than
one name beginning with those letters you have typed, it will beep, prompting you to type a few more
letters before pressing the tab key again.
History - The shell keeps a list of the commands you have typed in. If you need to repeat a command,
use the cursor keys to scroll up and down the list or type history for a list of previous commands.
Files and processes
Everything in UNIX is either a file or a process.
A process is an executing program identified by a unique PID (process identifier).
A file is a collection of data. They are created by users using text editors, running compilers etc.
Examples of files:
a document (report, essay etc.)
the text of a program written in some high-level programming language
instructions comprehensible directly to the machine and incomprehensible to a casual user, for
example, a collection of binary digits (an executable or binary file);
a directory, containing information about its contents, which may be a mixture of other directories
(subdirectories) and ordinary files.
The Directory Structure
All the files are grouped together in the directory structure. The file-system is arranged in a hierarchical
structure, like an inverted tree. The top of the hierarchy is traditionally called root.
In the diagram above, we see that the directory ee51ab contains the subdirectory unixstuff and a file

proj.txt
Starting an Xterminal session
To start an Xterm session, click on the Xterminal icon at the bottom of your screen.
An Xterminal window will appear with a Unix prompt, waiting for you to start entering commands.
UNIX Tutorial One
1.1 Listing files and directories
ls (list)
When you first login, your current working directory is your home directory. Your home directory has
the same name as your user-name, for example, ee91ab, and it is where your personal files and
subdirectories are saved.
To find out what is in your home directory, type
% ls (short for list)
The ls command lists the contents of your current working directory.
There may be no files visible in your home directory, in which case, the UNIX prompt will be returned.
Alternatively, there may already be some files inserted by the System Administrator when your account
was created.
ls does not, in fact, cause all the files in your home directory to be listed, but only those ones whose
name does not begin with a dot (.) Files beginning with a dot (.) are known as hidden files and usually
contain important program configuration information. They are hidden because you should not change
them unless you are very familiar with UNIX!!!
To list all files in your home directory including those whose names begin with a dot, type
% ls -a
ls is an example of a command which can take options: -a is an example of an option. The options
change the behaviour of the command. There are online manual pages that tell you which options a
particular command can take, and how each option modifies the behaviour of the command. (See later
in this tutorial)
1.2 Making Directories
mkdir (make directory)
We will now make a subdirectory in your home directory to hold the files you will be creating and using
in the course of this tutorial. To make a subdirectory called unixstuff in your current working directory
type
% mkdir unixstuff
To see the directory you have just created, type
% ls
1.3 Changing to a different directory
cd (change directory)
The command cd directory means change the current working directory to 'directory'. The current
working directory may be thought of as the directory you are in, i.e. your current position in the filesystem tree.
To change to the directory you have just made, type
% cd unixstuff

Type ls to see the contents (which should be empty)


Exercise 1a
Make another directory inside the unixstuff directory called backups
1.4 The directories . and ..
Still in the unixstuff directory, type
% ls -a
As you can see, in the unixstuff directory (and in all other directories), there are two special directories
called (.) and (..)
In UNIX, (.) means the current directory, so typing
% cd .
NOTE: there is a space between cd and the dot
means stay where you are (the unixstuff directory).
This may not seem very useful at first, but using (.) as the name of the current directory will save a lot of
typing, as we shall see later in the tutorial.
(..) means the parent of the current directory, so typing
% cd ..
will take you one directory up the hierarchy (back to your home directory). Try it now.
Note: typing cd with no argument always returns you to your home directory. This is very useful if you
are lost in the file system.
1.5 Pathnames
pwd (print working directory)
Pathnames enable you to work out where you are in relation to the whole file-system. For example, to
find out the absolute pathname of your home-directory, type cd to get back to your home-directory and
then type
% pwd
The full pathname will look something like this /a/fservb/fservb/fservb22/eebeng99/ee91ab
which means that ee91ab (your home directory) is in the directory eebeng99 (the group
directory),which is located on the fservb file-server.
Note:
/a/fservb/fservb/fservb22/eebeng99/ee91ab
can be shortened to
/user/eebeng99/ee91ab
Exercise 1b
Use the commands ls, pwd and cd to explore the file system.
(Remember, if you get lost, type cd by itself to return to your home-directory)
1.6 More about home directories and pathnames
Understanding pathnames
First type cd to get back to your home-directory, then type
% ls unixstuff

to list the contents of your unixstuff directory.


Now type
% ls backups
You will get a message like this backups: No such file or directory
The reason is, backups is not in your current working directory. To use a command on a file (or
directory) not in the current working directory (the directory you are currently in), you must either cd to
the correct directory, or specify its full pathname. To list the contents of your backups directory, you
must type
% ls unixstuff/backups
~ (your home directory)
Home directories can also be referred to by the tilde ~ character. It can be used to specify paths starting
at your home directory. So typing
% ls ~/unixstuff
will list the contents of your unixstuff directory, no matter where you currently are in the file system.
What do you think
% ls ~
would list?
What do you think
% ls ~/..
would list?
Summary
ls
list files and directories
ls -a
list all files and directories
mkdir
make a directory
cd directory
change to named directory
cd
change to home-directory
cd ~
change to home-directory
cd ..
change to parent directory
pwd
display the path of the current directory
UNIX Tutorial Two
2.1 Copying Files

cp (copy)
cp file1 file2 is the command which makes a copy of file1 in the current working directory and calls it
file2
What we are going to do now, is to take a file stored in an open access area of the file system, and use
the cp command to copy it to your unixstuff directory.
First, cd to your unixstuff directory.
% cd ~/unixstuff
Then at the UNIX prompt, type,
% cp /vol/examples/tutorial/science.txt .
(Note: Don't forget the dot (.) at the end. Remember, in UNIX, the dot means the current directory.)
The above command means copy the file science.txt to the current directory, keeping the name the
same.
(Note: The directory /vol/examples/tutorial/ is an area to which everyone in the department has read
and copy access. If you are from outside the University, you can grab a copy of the file here. Use
'File/Save As..' from the menu bar to save it into your unixstuff directory.)
Exercise 2a
Create a backup of your science.txt file by copying it to a file called science.bak
2.2 Moving files
mv (move)
mv file1 file2 moves (or renames) file1 to file2
To move a file from one place to another, use the mv command. This has the effect of moving rather
than copying the file, so you end up with only one file rather than two.
It can also be used to rename a file, by moving the file to the same directory, but giving it a different
name.
We are now going to move the file science.bak to your backup directory.
First, change directories to your unixstuff directory (can you remember how?). Then, inside the unixstuff
directory, type
% mv science.bak backups/.
Type ls and ls backups to see if it has worked.
2.3 Removing files and directories
rm (remove), rmdir (remove directory)
To delete (remove) a file, use the rm command. As an example, we are going to create a copy of the
science.txt file then delete it.
Inside your unixstuff directory, type
% cp science.txt tempfile.txt% ls (to check if it has created the file)% rm tempfile.txt % ls (to check if it
has deleted the file)
You can use the rmdir command to remove a directory (make sure it is empty first). Try to remove the
backups directory. You will not be able to since UNIX will not let you remove a non-empty directory.
Exercise 2b
Create a directory called tempstuff using mkdir , then remove it using the rmdir command.

2.4 Displaying the contents of a file on the screen


clear (clear screen)
Before you start the next section, you may like to clear the terminal window of the previous commands
so the output of the following commands can be clearly understood.
At the prompt, type
% clear
This will clear all text and leave you with the % prompt at the top of the window.
cat (concatenate)
The command cat can be used to display the contents of a file on the screen. Type:
% cat science.txt
As you can see, the file is longer than than the size of the window, so it scrolls past making it
unreadable.
less
The command less writes the contents of a file onto the screen a page at a time. Type
% less science.txt
Press the [space-bar] if you want to see another page, type [q] if you want to quit reading. As you can
see, less is used in preference to cat for long files.
head
The head command writes the first ten lines of a file to the screen.
First clear the screen then type
% head science.txt
Then type
% head -5 science.txt
What difference did the -5 do to the head command?
tail
The tail command writes the last ten lines of a file to the screen.
Clear the screen and type
% tail science.txt
How can you view the last 15 lines of the file?
2.5 Searching the contents of a file
Simple searching using less
Using less, you can search though a text file for a keyword (pattern). For example, to search through
science.txt for the word 'science', type
% less science.txt
then, still in less (i.e. don't press [q] to quit), type a forward slash [/] followed by the word to search
/science
As you can see, less finds and highlights the keyword. Type [n] to search for the next occurrence of the

word.
grep (don't ask why it is called grep)
grep is one of many standard UNIX utilities. It searches files for specified words or patterns. First clear
the screen, then type
% grep science science.txt
As you can see, grep has printed out each line containg the word science.
Or has it????
Try typing
% grep Science science.txt
The grep command is case sensitive; it distinguishes between Science and science.
To ignore upper/lower case distinctions, use the -i option, i.e. type
% grep -i science science.txt
To search for a phrase or pattern, you must enclose it in single quotes (the apostrophe symbol). For
example to search for spinning top, type
% grep -i 'spinning top' science.txt
Some of the other options of grep are:
-v display those lines that do NOT match -n precede each maching line with the line number -c print only
the total count of matched lines
Try some of them and see the different results. Don't forget, you can use more than one option at a
time, for example, the number of lines without the words science or Science is
% grep -ivc science science.txt
wc (word count)
A handy little utility is the wc command, short for word count. To do a word count on science.txt, type
% wc -w science.txt
To find out how many lines the file has, type
% wc -l science.txt
Summary
cp file1 file2
copy file1 and call it file2
mv file1 file2
move or rename file1 to file2
rm file
remove a file
rmdir directory
remove a directory
cat file
display a file
more file
display a file a page at a time
head file

display the first few lines of a file


tail file
display the last few lines of a file
grep 'keyword' file
search a file for keywords
wc file
count number of lines/words/characters in file
UNIX Tutorial Three
3.1 Redirection
Most processes initiated by UNIX commands write to the standard output (that is, they write to the
terminal screen), and many take their input from the standard input (that is, they read it from the
keyboard). There is also the standard error, where processes write their error messages, by default, to
the terminal screen.
We have already seen one use of the cat command to write the contents of a file to the screen.
Now type cat without specifing a file to read
% cat
Then type a few words on the keyboard and press the [Return] key.
Finally hold the [Ctrl] key down and press [d] (written as ^D for short) to end the input.
What has happened?
If you run the cat command without specifing a file to read, it reads the standard input (the keyboard),
and on receiving the'end of file' (^D), copies it to the standard output (the screen).
In UNIX, we can redirect both the input and the output of commands.
3.2 Redirecting the Output
We use the > symbol to redirect the output of a command. For example, to create a file called list1
containing a list of fruit, type
% cat > list1
Then type in the names of some fruit. Press [Return] after each one.
pearbananaapple^D (Control D to stop)
What happens is the cat command reads the standard input (the keyboard) and the > redirects the
output, which normally goes to the screen, into a file called list1
To read the contents of the file, type
% cat list1
Exercise 3a
Using the above method, create another file called list2 containing the following fruit: orange, plum,
mango, grapefruit. Read the contents of list2
The form >> appends standard output to a file. So to add more items to the file list1, type
% cat >> list1
Then type in the names of more fruit
peachgrapeorange^D (Control D to stop)
To read the contents of the file, type
% cat list1

You should now have two files. One contains six fruit, the other contains four fruit. We will now use the
cat command to join (concatenate) list1 and list2 into a new file called biglist. Type
% cat list1 list2 > biglist
What this is doing is reading the contents of list1 and list2 in turn, then outputing the text to the file
biglist
To read the contents of the new file, type
% cat biglist
3.3 Redirecting the Input
We use the < symbol to redirect the input of a command.
The command sort alphabetically or numerically sorts a list. Type
% sort
Then type in the names of some vegetables. Press [Return] after each one.
carrotbeetrootartichoke^D (control d to stop)
The output will be
artichokebeetroot carrot
Using < you can redirect the input to come from a file rather than the keyboard. For example, to sort the
list of fruit, type
% sort < biglist
and the sorted list will be output to the screen.
To output the sorted list to a file, type,
% sort <> slist
Use cat to read the contents of the file slist
3.4 Pipes
To see who is on the system with you, type
% who
One method to get a sorted list of names is to type,
% who > names.txt% sort < names.txt
This is a bit slow and you have to remember to remove the temporary file called names when you have
finished. What you really want to do is connect the output of the who command directly to the input of
the sort command. This is exactly what pipes do. The symbol for a pipe is the vertical bar
For example, typing
% who sort
will give the same result as above, but quicker and cleaner.
To find out how many users are logged on, type
% who wc -l
Exercise 3b
a2ps -Phockney textfile is the command to print a postscript file to the printer hockney.
Using pipes, print all lines of list1 and list2 containing the letter 'p', sort the result, and print to the
printer hockney.
Answer available here
Summary
command > file

redirect standard output to a file


command >> file
append standard output to a file
command < file
redirect standard input from a file
command1 command2
pipe the output of command1 to the input of command2
cat file1 file2 > file0
concatenate file1 and file2 to file0
sort
sort data
who
list users currently logged in
a2ps -Pprinter textfile
print text file to named printer
lpr -Pprinter psfile
print postscript file to named printer
UNIX Tutorial Four
4.1 Wildcards
The characters * and ?
The character * is called a wildcard, and will match against none or more character(s) in a file (or
directory) name. For example, in your unixstuff directory, type
% ls list*
This will list all files in the current directory starting with list....
Try typing
% ls *list
This will list all files in the current directory ending with ....list
The character ? will match exactly one character.So ls ?ouse will match files like house and mouse, but
not grouse. Try typing
% ls ?list
4.2 Filename conventions
We should note here that a directory is merely a special type of file. So the rules and conventions for
naming files apply also to directories.
In naming files, characters with special meanings such as / * & % , should be avoided. Also, avoid using
spaces within names. The safest way to name a file is to use only alphanumeric characters, that is,
letters and numbers, together with _ (underscore) and . (dot).
File names conventionally start with a lower-case letter, and may end with a dot followed by a group of
letters indicating the contents of the file. For example, all files consisting of C code may be named with
the ending .c, for example, prog1.c . Then in order to list all files containing C code in your home
directory, you need only type ls *.c in that directory.
Beware: some applications give the same name to all the output files they generate. For example, some
compilers, unless given the appropriate option, produce compiled files named a.out. Should you forget

to use that option, you are advised to rename the compiled file immediately, otherwise the next such
file will overwrite it and it will be lost.
4.3 Getting Help
On-line Manuals
There are on-line manuals which gives information about most commands. The manual pages tell you
which options a particular command can take, and how each option modifies the behaviour of the
command. Type man command to read the manual page for a particular command.
For example, to find out more about the wc (word count) command, type
% man wc
Alternatively
% whatis wc
gives a one-line description of the command, but omits any information about options etc.
Apropos
When you are not sure of the exact name of a command,
% apropos keyword
will give you the commands with keyword in their manual page header. For example, try typing
% apropos copy
Summary
*
match any number of characters
?
match one character
man command
read the online manual page for a command
whatis command
brief description of a command
apropos keyword
match commands with keyword in their man pages
UNIX Tutorial Five
5.1 File system security (access rights)
In your unixstuff directory, type
% ls -l (l for long listing!)
You will see that you now get lots of details about the contents of your directory, similar to the example
below.
Each file (and directory) has associated access rights, which may be found by typing ls -l. Also, ls -lg gives
additional information as to which group owns the file (beng95 in the following example):
-rwxrw-r-- 1 ee51ab beng95 2450 Sept29 11:52 file1
In the left-hand column is a 10 symbol string consisting of the symbols d, r, w, x, -, and, occasionally, s or
S. If d is present, it will be at the left hand end of the string, and indicates a directory: otherwise - will be
the starting symbol of the string.
The 9 remaining symbols indicate the permissions, or access rights, and are taken as three groups of 3.
The left group of 3 gives the file permissions for the user that owns the file (or directory) (ee51ab in the

above example);
the middle group gives the permissions for the group of people to whom the file (or directory) belongs
(eebeng95 in the above example);
the rightmost group gives the permissions for all others.
The symbols r, w, etc., have slightly different meanings depending on whether they refer to a simple file
or to a directory.
Access rights on files.
r (or -), indicates read permission (or otherwise), that is, the presence or absence of permission to read
and copy the file
w (or -), indicates write permission (or otherwise), that is, the permission (or otherwise) to change a file
x (or -), indicates execution permission (or otherwise), that is, the permission to execute a file, where
appropriate
Access rights on directories.
r allows users to list files in the directory;
w means that users may delete files from the directory or move files into it;
x means the right to access files in the directory. This implies that you may read files in the directory
provided you have read permission on the individual files.
So, in order to read a file, you must have execute permission on the directory containing that file, and
hence on any directory containing that directory as a subdirectory, and so on, up the tree.
Some examples
-rwxrwxrwx
a file that everyone can read, write and execute (and delete).
-rw------a file that only the owner can read and write - no-one else can read or write and no-one has execution
rights (e.g. your mailbox file).
5.2 Changing access rights
chmod (changing a file mode)
Only the owner of a file can use chmod to change the permissions of a file. The options of chmod are as
follows
Symbol
Meaning
u
user
g
group
o
other
a
all
r
read
w

write (and delete)


x
execute (and access directory)
+
add permission
take away permission
For example, to remove read write and execute permissions on the file biglist for the group and others,
type
% chmod go-rwx biglist
This will leave the other permissions unaffected.
To give read and write permissions on the file biglist to all,
% chmod a+rw biglist
Exercise 5a
Try changing access permissions on the file science.txt and on the directory backups
Use ls -l to check that the permissions have changed.
5.3 Processes and Jobs
A process is an executing program identified by a unique PID (process identifier). To see information
about your processes, with their associated PID and status, type
% ps
A process may be in the foreground, in the background, or be suspended. In general the shell does not
return the UNIX prompt until the current process has finished executing.
Some processes take a long time to run and hold up the terminal. Backgrounding a long process has the
effect that the UNIX prompt is returned immediately, and other tasks can be carried out while the
original process continues executing.
Running background processes
To background a process, type an & at the end of the command line. For example, the command sleep
waits a given number of seconds before continuing. Type
% sleep 10
This will wait 10 seconds before returning the command prompt %. Until the command prompt is
returned, you can do nothing except wait.
To run sleep in the background, type
% sleep 10 &
[1] 6259
The & runs the job in the background and returns the prompt straight away, allowing you do run other
programs while waiting for that one to finish.
The first line in the above example is typed in by the user; the next line, indicating job number and PID,
is returned by the machine. The user is be notified of a job number (numbered from 1) enclosed in
square brackets, together with a PID and is notified when a background process is finished.
Backgrounding is useful for jobs which will take a long time to complete.
Backgrounding a current foreground process
At the prompt, type

% sleep 100
You can suspend the process running in the foreground by holding down the [control] key and typing [z]
(written as ^Z) Then to put it in the background, type
% bg
Note: do not background programs that require user interaction e.g. pine
5.4 Listing suspended and background processes
When a process is running, backgrounded or suspended, it will be entered onto a list along with a job
number. To examine this list, type
% jobs
An example of a job list could be
[1] Suspended sleep 100[2] Running netscape[3] Running nedit
To restart (foreground) a suspended processes, type
% fg %jobnumber
For example, to restart sleep 100, type
% fg %1
Typing fg with no job number foregrounds the last suspended process.
5.5 Killing a process
kill (terminate or signal a process)
It is sometimes necessary to kill a process (for example, when an executing program is in an infinite
loop)
To kill a job running in the foreground, type ^C (control c). For example, run
% sleep 100^C
To kill a suspended or background process, type
% kill %jobnumber
For example, run
% sleep 100 &% jobs
If it is job number 4, type
% kill %4
To check whether this has worked, examine the job list again to see if the process has been removed.
ps (process status)
Alternatively, processes can be killed by finding their process numbers (PIDs) and using kill PID_number
% sleep 100 &% ps
PID TT S TIME COMMAND20077 pts/5 S 0:05 sleep 10021563 pts/5 T 0:00 netscape21873 pts/5 S 0:25
nedit
To kill off the process sleep 100, type
% kill 20077
and then type ps again to see if it has been removed from the list.
If a process refuses to be killed, uses the -9 option, i.e. type
% kill -9 20077
Note: It is not possible to kill off other users' processes !!!
Summary
ls -lag

list access rights for all files


chmod [options] file
change access rights for named file
command &
run command in background
^C
kill the job running in the foreground
^Z
suspend the job running in the foreground
bg
background the suspended job
jobs
list current jobs
fg %1
foreground job number 1
kill %1
kill job number 1
ps
list current processes
kill 26152
kill process number 26152
UNIX Tutorial Six
Other useful UNIX commands
quota
All students are allocated a certain amount of disk space on the file system for their personal files,
usually about 5 Megabyes (equivalent to 4 floppy disks worth). If you go over your quota, you are given
7 days to remove excess files.
To check your current quota and how much of it you have used, type
% quota -v
df
The df command reports on the space left on the file system. For example, to find out how much space
is left on the fileserver, type
% df .
du
The du command outputs the number of kilobyes used by each subdirectory. Useful if you have gone
over quota and you want to find out which directory has the most files. In your home-directory, type
% du
compress
This reduces the size of a file, thus freeing valuable disk space. For example, type
% ls -l science.txt
and note the size of the file. Then to compress science.txt, type
% compress science.txt

This will compress the file and place it in a file called science.txt.Z
To see the change in size, type ls -l again.
To uncomress the file, use the uncompress command.
% uncompress science.txt.Z
gzip
This also compresses a file, and is more efficient than compress. For example, to zip science.txt, type
% gzip science.txt
This will zip the file and place it in a file called science.txt.gz
To unzip the file, use the gunzip command.
% gunzip science.txt.gz
file
file classifies the named files according to the type of data they contain, for example ascii (text),
pictures, compressed data, etc.. To report on all files in your home directory, type
% file *
history
The C shell keeps an ordered list of all the commands that you have entered. Each command is given a
number according to the order it was entered.
% history (show command history list)
If you are using the C shell, you can use the exclamation character (!) to recall commands easily.
% !! (recall last command)
% !-3 (recall third most recent command)
% !5 (recall 5th command in list)
% !grep (recall last command starting with grep)
You can increase the size of the history buffer by typing
% set history=100
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 6:51 PM 0
comments
QTP10.00 New Features
New Features of QTP 10.00
1. Centrally Manage and Share Testing Assets, Dependencies, and Versions in Quality Center 10.00
In the earlier version of QC, the Test Assets like ( Repository, Library, Recoveries ) are placed in the
Attachments and if these assets are associated to the Test there is no dependencies information.
In QC 10.00 there is a new Section called Test Resources in the section we can place all the Assets and
associate these to the Test Script. The QC tool maintains the dependencies information between the
Assets and Test Script.
It also provides build in Version control; when the Test case/ scripts ..etc is checkout and checkin into QC
it will maintain a new version which is similar concept in VSS.
2. Perform Single-User Local System Monitoring While Running Your Tests
we can observe the performance of the local system when the script is executed. Like usage of memory,
GDI objects, Thread counters.

Navigation: To select the Local System Motitoring


File menu-->Settings--> Local System Monitoring
Select the Enable Local System Monitoring every seconds
Select the Application name
Select the counter and Limit size
After the Test Run, the status is shown in the Test Results
3. Improve Portability by Saving Copies of Tests Together with Their Resource Files
When we save the test from QC into local system ; all the associated assets like Object Repositories,
Function Libraries, Recovery Scenarios are also copied to the local system and we can run the script
from local system with out any change in the assoication assets path / with out any changes.
Steps :
Open the Test in QTP which is in the QC
File menu select Save Test with Resources
Following type of details are displayed
select the location in local system to save the file and save
4. Call Actions Dynamically During the Test Run
we can dynamically load and run actions instead of Call to Existing action and associating the reusable
Actions. These action is loaded into memory and run only when the statement is executed and not
during the Test / Action open.
Syntax: Loadandrunaction Path of QTP test,Actioname
Important Information
The action is loaded only when the step runs (and not when the test opens). Therefore:
The action is never listed in:
The Resources pane in QuickTest.
The Test Flow pane in QuickTest.
The Missing Resources pane in QuickTest.
The Dependencies tab in the Quality Center Test Resources module.
This can affect test maintenance because the action can potentially be modified or deleted with its
parent test without anyone realizing that it is called by this test. Conversely, when performing
maintenance on this test, this action can be overlooked because it is not clearly visible as a resource.
Run performance can be affected because the action is loaded and run during the run session (and not
when the test is opened).
During a run session, you can view the actions that are run using the LoadAndRunAction statement. As
an action begins to run, the action name is displayed in the LoadAndRunAction Calls section of the
Action toolbar in the Keyword View and in the Expert View. The called actions remain listed in the
toolbar until the end of the run session, at which point they are cleared from the list.
At the end of a run session, all of the actions that were dynamically loaded are unloaded. In the Test
Results window, you can view the steps that ran during the run session.
5. Develop Your Own Bitmap Checkpoint Comparison Algorithm
By default, a bitmap checkpoint compares the actual and expected bitmaps pixel by pixel and fails if
there are any differences. QuickTest enables its users to define tolerance levels for bitmap checkpoints
to refine the bitmap comparison and make it more flexible. For more information, see Fine-Tuning the

Bitmap Comparison.
If you need to further customize the way bitmaps are compared in checkpoints, you can develop custom
comparers that compare bitmaps according to your requirements. You develop a custom comparer as a
COM object and install and register it on the QuickTest computer. A QuickTest user can then choose to
use a custom comparer to perform the comparison in a bitmap checkpoint (on a per checkpoint basis).
Note : for more information on Customizing the Alogrithm Please Refer Help in QTP
6. Centrally Manage Your Work Items and ToDo Tasks in the To Do Pane
we can make a note of all the tasks to be perfomed in the TODO Pane
View menu--> To Do List
7. Improve Test Results Analysis with New Reporting Functionality
A. Export Results Report
The results can be exported to DOC, PDF files also apart from HTML.
In the Results window ; File menu--> Export Report
B. Reporter.ReportEvent
During the script execution for any failed steps we can capture the bitmap and display it in the results
window along with Reporter.ReportEvent method
Example:
If condition is falied then
Window(Flight Reservation).CaptureBitmap b1.bmp
Reporter.ReportEvent 1,Error,The error message in the window,b1.bmp
End if
C. Jumping to a Step in QuickTest
We can view the step in QuickTest that corresponds to a node in the run results tree.
To view the step in the test that corresponds to a node:
Select a node in the run results tree.
Perform one of the following:
Click the Jump to Step in QuickTest button from the Run Results toolbar.
Right-click and select Jump to Step in QuickTest from the context-sensitive menu.
Select View > Jump to Step in QuickTest.
The QuickTest window is activated and the step is highlighted.
8. Test Standard and Custom Delphi Objects Using the Delphi Add-in and Delphi Add-in Extensibility
We can use the QuickTest Professional Delphi Add-in to test objects in Delphi applications. We can
create and run tests and components on these objects, as well as check their properties. We create and
run tests and components on Delphi applications in much the same way as you do for other Windowsbased applications.
The Delphi Add-in provides test objects, methods, and properties that can be used when testing objects
in Delphi applications
Product Enhancements
1.Upgrade from QuickTest 9.5

If QuickTest 9.5 is installed on the computer, we can choose to upgrade to QuickTest version 10.00. This
enables us to continue using many of the configurations and options we have already set in QuickTest
9.5. We can also use an msi silent installation command line to upgrade from QuickTest 9.5.
2.Improved IntelliSense Functionality
QuickTest now provides full IntelliSense for the following types of objects:
Objects created by a step or function (for example, by calling the CreateObject method)
Variables to which an object is assigned
Reserved objects
COM objects
Properties that return objects
3.Added Control for Editing and Managing Actions in Automation Scripts
The QuickTest Professional Automation Object Model has a new set of objects and methods for
manipulating test actions and action parameters. We can now use automation scripts to create new
actions, modify and validate the syntax of action scripts, create and modify action parameters, and
more.
4.Improved Debugger Pane Design and Functionality
The Debug Viewer pane has a new look, including icons to help us identify the type of information
displayed.
The Watch tab and Variable tab now display the types of expressions or variables, in addition to their
names and values.
The Command tab now displays the command history (in read-only format) in addition to the command
line, enabling us to view previously-run commands and select commands to reuse.
In addition, a right-click context menu in the Command tab enables us to:
copy from the command history and edit the command line using the clipboard.
clear the command history.
5.New Object Identification Solutions in Maintenance Run Mode
In addition to helping us update the steps and object repositories when objects in the application
change, the Maintenance Run Wizard can now help to solve the following problems:
The step failed because the object in the test is missing from the action's associated object repositories.
The object in the step exists in the application, but can be identified only through Smart Identification.
6.Additional Configuration Settings for Text Recognition Mechanism
We can now set all text recognition configuration settings from the QuickTest Options Dialog Box (Tools
> Options > General > Text Recognition), including new options for selecting the text block mode and
specifying the languages to be used with the OCR mechanism. This makes it easier to make any
necessary adjustments and to optimize the way that QuickTest identifies text in the application.
7.New Look for Options, Settings, and File Dialog Boxes
The QuickTest Options and Settings dialog boxes have changed from their former tab-based design to a
more easily navigable tree-based structure. The tree contains only the options relevant for the add-ins
that are currently loaded.
8.QuickTest Toolbar Customization Options
We can use the new Customize Dialog box (Tools > Customize) to customize the appearance of existing
menus and toolbars, and to create our own user-defined menus, toolbar buttons, and shortcuts.

We can also add new commands to the QuickTest Tools menu so that we can launch an application
directly from the menu. For example, we can use this option to create a shortcut to the application we
want to test or to an automation script.
9.Improved Web Extensibility
QuickTest Professional Web Add-in Extensibility enables us to develop packages that provide high-level
support for third-party and custom Web controls that are not supported out-of-the-box by the Web
Add-in.
Limited extensibility support for the ASP .NET AJAX Control toolkit is provided with the extensibility
installation. We can use this package as an example for reference or as a basis for our own Ajax
extensibility packages.
By creating support for a Web control using Web Add-in Extensibility, we can direct QuickTest to
recognize the control as belonging to a specific test object class. We can also extend the list of available
test object classes that QuickTest is able to recognize and the list of operations that are available for
each class. This enables us to create tests that fully support the specific behavior of custom Web
controls.
The QuickTest Professional Web Add-in Extensibility SDK 10.00 offers the following improvements:
The Web Add-in Extensibility SDK now provides a global object, window, that we can use in the
JavaScript code to access the Internet Explorer global namespace. This enables us to access client-side
JavaScript objects and functions in the application we are testing.
We can now use the Microsoft Script Debugger or the Microsoft Visual Studio debugger to debug
JavaScript code that we write for Web Add-in Extensibility.
The LogLine method provided by the _util object can now (optionally) accept a numeric ID and a
numeric Category for the log entry that it passes to the event log. Users can later use this information to
filter log entries in the Event Viewer. In addition, the LogLine method can now accept string values for
the severity argument, in addition to numeric values.
10. .NET Add-in and Extensibility Improvements
The .NET Add-in provides the following new objects and methods:
The .NET Add-in now supports learning, recording, and running on .NET Windows Forms property grids.
QuickTest learns these controls using the new SwfPropertyGrid test object class.
The .NET Add-in has a new GetErrorProviderText method and ErrorProviderText identification property,
which is supported for all .NET Windows Forms test objects. We can use this method or property to
retrieve the tooltip text of the error icon associated with the object.
.NET Add-in Extensibility includes the following enhancements:
The C# and Visual Basic project templates and wizards provided with the .NET Add-in Extensibility SDK
installation are now provided on Microsoft Visual Studio 2008 (as well as on Microsoft Visual Studio .NET
and Microsoft Visual Studio 2005).
.NET Add-in Extensibility now enables users to create support for table checkpoints on custom .NET
Windows Forms table controls.
11.New Terminal Emulator Configuration Validation
The Terminal Emulator pane of the Options dialog box now includes a Validate button. When we click
this button, QuickTest checks the current configurations of the selected emulator. If a problem is

detected, a brief description is displayed in the pane. We can also click the Troubleshoot button to view
a Help page that provides additional information about the detected problem.
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:50 AM

Friday, November 6, 2009


UseCases
A use Case Diagram Describes the Communication flow ( Request & Response) between the external
user and the system / Internal communication between 2 different components.
The Technical usecase Describes the Requirement Details; The Technical usecase for a Requirement has
the below details
UseCaseID : A Unique ID for the usecase
UseCaseName : Name of the USeCase
Goal : What is the purpose of the usecase and output
Actor : The users who will have permission to interact with the system
Description : Describe about the functionality of the Requirement
PreConditions : The Preconditions to be satisfied for the requirement to be started
PostConditions : The final output after execution of the requirement
Exceptions : Describes any exceptions / errors might occur during execution of the Req.
Priority : Priority of the Requirement High / Medium / Low
Fequency of use : How frequently the requirement is used in the application
Assumptions : List any assumptions made by the Analyst during the preparation of the Req Details
Check the below doc
www.processimpact.com/process_assets/use_case_template.doc
The below links also Provide you good information on usecases Diagram for ATM Functionality
http://courses.knox.edu/cs292/ATMExample/UseCases.html
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:24 AM 0
comments
SOA Testing
A Good Document on SOA Testing and Architecture
http://www.thbs.com/pdfs/SOA_Test_Methodology.pdf
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 2:01 AM 0
comments
Thursday, November 5, 2009
Database Programming
Dim cn,rs
Set cn=CreateObject("ADODB.Connection")

Set rs=CreateObject("ADODB.RecordSet")
cn.Open "Provider=SQLOLEDB;server=class301;database=employee;trusted_connection=yes"
rs.Open "select * from emp",cn
While rs.EOF<>True
print rs("eno")&" "&rs("ename")&" "&rs("sal")&" "&rs("depcode")
rs.MoveNext
Wend
rs.Close
cn.Close
==================================
'Connection syntax for different databases
'cn.Open "Provider=ORADB;server=servername;userid=xxxx;pwd=xxxx"
'cn.Open "Provider=SQLOLEDB;server=class301;database=employee;uid=xxxxx;pwd=xxxx"
'cn.Open "Provider=Microsoft.jet.oledb.4.0; data source=e:\employee.mdb"
==================================================
Dim cn,rs
Set cn=CreateObject("ADODB.Connection")
Set rs=CreateObject("ADODB.Recordset")
cn.Open "DSN=d1"
rs.Open "select eno,ename from emp",cn
While rs.EOF<>True
print rs("eno")&" "&rs("ename")
rs.MoveNext
Wend
rs.Close
cn.Close
===========================================
Dim cn,rs
Set cn=CreateObject("ADODB.Connection")
Set rs=CreateObject("ADODB.RecordSet")
cn.Open "DSN=QT_Flight32"
For i=1 to 5
Window("Flight Reservation").WinMenu("Menu").Select "File;Open Order..."
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set i
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
cname=window("Flight Reservation").WinEdit("Name:").GetROProperty("text")
tickets=window("Flight Reservation").WinEdit("Tickets:").GetROProperty("text")
rs.Open "select * from orders where order_number="&i,cn
If rs("customer_name")=cname and rs("tickets_ordered")=cint(tickets) Then
Reporter.ReportEvent 0,"Data","The record is matching "
else

Reporter.ReportEvent 1,"Data","The record is not matching"


End If
rs.Close
Next
cn.Close
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 11:40 PM 0
comments
VB Script
What is VBScript?
VBScript is a scripting language
A scripting language is a lightweight programming language
VBScript is a light version of Microsoft's programming language Visual Basic
How does it Work?
When a VBScript is inserted into a HTML document, the Internet browser will read the HTML and
interpret the VBScript. The VBScript can be executed immediately, or at a later event.
How to Put VBScript Code
Print Hellow from VBScript!
And it produces this output:
Hello from VBScript!

Example :
Dim x,y
x=inputbox(Enter a number)
y=inputbox(Enter a number)
print x*y
Example 2
Dim x,y
x=inputbox(Enter a number)
y=inputbox(Enter a number)
msgbox The product of x * y &vbcrlf&x*y,1,Product
In the above example msgbox message,buttons,title
What is a Variable?
A variable is a "container" for information you want to store. A variable's value can change during the
script. You can refer to a variable by name to see its value or to change its value. In VBScript, all variables
are of type variant, that can store different types of data.
Rules for Variable Names:

Must begin with a letter


Cannot contain a period (.)
Cannot exceed 255 characters
Declaring Variables
You can declare variables with the Dim, Public or the Private statement. Like this:
dim namename=some value
Now you have created a variable. The name of the variable is "name".
You can also declare variables by using its name in your script. Like this:
name=some value
Now you have also created a variable. The name of the variable is "name".
However, the last method is not a good practice, because you can misspell the variable name later in
your script, and that can cause strange results when your script is running. This is because when you
misspell for example the "name" variable to "nime" the script will automatically create a new variable
called "nime". To prevent your script from doing this you can use the Option Explicit statement. When
you use this statement you will have to declare all your variables with the dim, public or private
statement. Put the Option Explicit statement on the top of your script. Like this:
option explicitdim namename=some value
Assigning Values to Variables
You assign a value to a variable like this:
name="Hege"i=200
The variable name is on the left side of the expression and the value you want to assign to the variable is
on the right. Now the variable "name" has the value "Hege".
Lifetime of Variables
How long a variable exists is its lifetime.When you declare a variable within a procedure, the variable
can only be accessed within that procedure. When the procedure exits, the variable is destroyed. These
variables are called local variables. You can have local variables with the same name in different
procedures, because each is recognized only by the procedure in which it is declared.If you declare a
variable outside a procedure, all the procedures on your page can access it. The lifetime of these
variables starts when they are declared, and ends when the page is closed.
Array Variables
Sometimes you want to assign more than one value to a single variable. Then you can create a variable
that can contain a series of values. This is called an array variable. The declaration of an array variable
uses parentheses ( ) following the variable name. In the following example, an array containing 3
elements is declared:
dim names(2)
The number shown in the parentheses is 2. We start at zero so this array contains 3 elements. This is a
fixed-size array. You assign data to each of the elements of the array like this:
names(0)="Tove"names(1)="Jani"names(2)="Stale"
Similarly, the data can be retrieved from any element using the index of the particular array element you
want. Like this:
mother=names(0)

You can have up to 60 dimensions in an array. Multiple dimensions are declared by separating the
numbers in the parentheses with commas. Here we have a two-dimensional array consisting of 5 rows
and 7 columns:
dim table(4, 6)
Create an arrayArrays are used to store a series of related data items. This example demonstrates how
you can make an array that stores names. ( We are using a "for loop" to demonstrate how you write the
names. )
dim famname(5)
famname(0)="Jan Egil"
famname(1)="Tove"
famname(2)="Hege"
famname(3)="Stale"
famname(4)="Kai Jim"
famname(5)="Borge"
for i=0 to 5
print famname(i)
next
Result
Jan EgilToveHegeStaleKai JimBorge
We have two kinds of procedures: The Sub procedure and the Function procedure.
A Sub procedure:
is a series of statements, enclosed by the Sub and End Sub statements
can perform actions, but does not return a value
can take arguments that are passed to it by a calling procedure
without arguments, must include an empty set of parentheses ()
Sub mysub() some statementsEnd Sub
or Sub mysub(argument1,argument2) some statementsEnd Sub
A Function procedure:
is a series of statements, enclosed by the Function and End Function statements
can perform actions and can return a value
can take arguments that are passed to it by a calling procedure
without arguments, must include an empty set of parentheses ()
returns a value by assigning a value to its name
Function myfunction() some statements myfunction=some valueEnd Function
orFunction myfunction(argument1,argument2) some statements myfunction=some valueEnd Function
Call a Sub or Function Procedure
When you call a Function in your code, you do like this:
name = findname()
Here you call a Function called "findname", the Function returns a value that will be stored in the
variable "name".

Or, you can do like this:


msgbox "Your name is " & findname()
Here you also call a Function called "findname", the Function returns a value that will be displayed in the
message box.
When you call a Sub procedure you can use the Call statement, like this:
Call MyProc(argument)
Or, you can omit the Call statement, like this:
MyProc argument
Examples
Sub procedureThe sub procedure does not return a value.
sub mySub()
msgbox("This is a sub procedure")
end sub
call mySub()
Result
A sub procedure does not return a result.
Function procedureThe function procedure is used if you want to return a value.
function myFunction()
myFunction = "BLUE"
end function
call myFunction
Result
My favorite color is BLUE
A function procedure CAN return a result.
Examples
The if...then...else statementThis example demonstrates how to write the if...then..else statement.
The if...then...elseif... statementThis example demonstrates how to write the if...then...elseif statement.
The select case statementThis example demonstrates how to write the select case statement.
Conditional Statements
Very often when you write code, you want to perform different actions for different decisions. You can
use conditional statements in your code to do this.
In VBScript we have three conditional statements:
if statement - use this statement if you want to execute a set of code when a condition is true
if...then...else statement - use this statement if you want to select one of two sets of lines to execute
if...then...elseif statement - use this statement if you want to select one of many sets of lines to execute
select case statement - use this statement if you want to select one of many sets of lines to execute
If....Then.....Else
You should use the If...Then...Else statement if you want to
execute some code if a condition is true
select one of two blocks of code to execute
If you want to execute only one statement when a condition is true, you can write the code on one line:

if i=10 Then msgbox "Hello"


There is no ..else.. in this syntax. You just tell the code to perform one action if the condition is true (in
this case if i=10).
If you want to execute more than one statement when a condition is true, you must put each statement
on separate lines and end the statement with the keyword "End If":
if i=10 Then msgbox "Hello" i = i+1end If
There is no ..else.. in this syntax either. You just tell the code to perform multiple actions if the condition
is true.
If you want to execute a statement if a condition is true and execute another statement if the condition
is not true, you must add the "Else" keyword:
if i=10 then msgbox "Hello"else msgbox "Goodbye"end If
The first block of code will be executed if the condition is true, and the other block will be executed
otherwise (if i is not equal to 10).
If....Then.....Elseif
You can use the if...then...elseif statement if you want to select one of many blocks of code to execute:
if payment="Cash" then msgbox "You are going to pay cash!" elseif payment="Visa" then msgbox "You
are going to pay with visa." elseif payment="AmEx" then msgbox "You are going to pay with American
Express." else msgbox "Unknown method of payment."end If
Select Case
You can also use the SELECT statement if you want to select one of many blocks of code to execute:
select case payment case "Cash" msgbox "You are going to pay cash" case "Visa" msgbox "You are going
to pay with visa" case "AmEx" msgbox "You are going to pay with American Express" case Else msgbox
"Unknown method of payment"end select
This is how it works: First we have a single expression (most often a variable), that is evaluated once.
The value of the expression is then compared with the values for each Case in the structure. If there is a
match, the block of code associated with that Case is executed.
Examples
The if...then...else statementThis example demonstrates how to write the if...then..else statement.
function greeting()
i=hour(time)
if i < 10 then
msgbox Good morning
else
msgbox Have a nice day!
end if
end function
Result
Have a nice day!
The if...then...elseif... statementThis example demonstrates how to write the if...then...elseif statement.
function greeting()
i=hour(time)

If i = 10 then
Print "Just started...!"
elseif i = 11 then
print "Hungry!"
elseif i = 12 then
print "Ah, lunch-time!"
elseif i = 16 then
print "Time to go home!"
else
print "Time zone = Chennai, Kolkatta, Mumbai and Delhi"
end if
end function
call greeting()
Result
Time zone = Chennai, Kolkatta, Mumbai and Delhi
The select case statementThis example demonstrates how to write the select case statement.
d=weekday(date)
select case d
case 1
print "Sleepy Sunday"
case 2
print "Monday again!"
case 3
print "Just Tuesday!"
case 4
print "Wednesday!"
case 5
print "Thursday..."
case 6
print "Finally Friday!"
case else
print "Super Saturday!!!!"
end select
Result
Just Tuesday!
This example demonstrates the "select case" statement.
You will receive a different greeting based on what day it is.
Note that Sunday=1, Monday=2, Tuesday=3, etc.
Looping Statements
Very often when you write code, you want to allow the same block of code to run a number of times.
You can use looping statements in your code to do this.

In VBScript we have four looping statements:


For...Next statement - runs statements a specified number of times.
For Each...Next statement - runs statements for each item in a collection or each element of an array
Do...Loop statement - loops while or until a condition is true
While...Wend statement - Do not use it - use the Do...Loop statement instead
For...Next Loop
You can use a For...Next statement to run a block of code, when you know how many repetitions you
want.
You can use a counter variable that increases or decreases with each repetition of the loop, like this:
For i=1 to 10 some codeNext
The For statement specifies the counter variable (i) and its start and end values. The Next statement
increases the counter variable (i) by one.
Step Keyword
Using the Step keyword, you can increase or decrease the counter variable by the value you specify.
In the example below, the counter variable (i) is increased by two each time the loop repeats.
For i=2 To 10 Step 2 some codeNext
To decrease the counter variable, you must use a negative Step value. You must specify an end value
that is less than the start value.
In the example below, the counter variable (i) is decreased by two each time the loop repeats.
For i=10 To 2 Step -2 some codeNext
Exit a For...Next
You can exit a For...Next statement with the Exit For keyword.
For Each...Next Loop
A For Each...Next loop repeats a block of code for each item in a collection, or for each element of an
array.
dim cars(2)cars(0)="Volvo"cars(1)="Saab"cars(2)="BMW" For Each x in cars Print x Next
Do...Loop
You can use Do...Loop statements to run a block of code when you do not know how many repetitions
you want. The block of code is repeated while a condition is true or until a condition becomes true.
Repeating Code While a Condition is True
You use the While keyword to check a condition in a Do...Loop statement.
Do While i>10 some codeLoop
If i equals 9, the code inside the loop above will never be executed.
Do some codeLoop While i>10
The code inside this loop will be executed at least one time, even if i is less than 10.
Repeating Code Until a Condition Becomes True
You use the Until keyword to check a condition in a Do...Loop statement.
Do Until i=10 some code Loop
If i equals 10, the code inside the loop will never be executed.
Do some codeLoop Until i=10
The code inside this loop will be executed at least one time, even if i is equal to 10.

Exit a Do...Loop
You can exit a Do...Loop statement with the Exit Do keyword.
Do Until i=10 i=i-1 If i<10 Then Exit DoLoop
The code inside this loop will be executed as long as i is different from 10, and as long as i is greater than
10.
Examples
For...next loopThis example demonstrates how to make a simple For....Next loop.
for i = 0 to 2
print "The number is " & i
next
Result
The number is 0
The number is 1
The number is 2
Looping through headersThis example demonstrates how you can loop through the 6 headers in html.
for i=4 to 6
print i
next
For...each loopThis example demonstrates how to make a simple For.....Each loop.
dim names(2)
names(1) = "Tove"
names(0) = "Jani"
names(2) = "Hege"
for each x in names
print x
next
Result
Jani
Tove
Hege
Do...While loopThis example demonstrates how to make a simple Do...While loop.
i=5
do while i < 10
print i
i=i+1
loop
Result
5, 6, 7, 8, 9,
This page contains all the built-in VBScript functions. The page is divided into following sections:
Date/Time functions
Conversion functions

Format functions
Math functions
Array functions
String functions
Other functions
Date/Time Functions
Function
CDate
Converts a valid date and time expression to the variant of subtype Date
The CDate function converts a valid date and time expression to type Date, and returns the result.
Tip: Use the IsDate function to determine if date can be converted to a date or time.
Note: The IsDate function uses local setting to determine if a string can be converted to a date
("January" is not a month in all languages.)
Syntax
CDate(date)
Parameter
Description
date
Required. Any valid date expression (like Date() or Now())
Example 1
d="April 22, 2001"if IsDate(d) then print CDate(d)end ifOutput:2/22/01
Example 2
d=#2/22/01#if IsDate(d) then print CDate(d)end ifOutput:2/22/01
Example 3
d="3:18:40 AM"if IsDate(d) then print CDate(d)end ifOutput:3:18:40 AM
Date
Returns the current system date
The Date function returns the current system date.
Syntax
Date
Example 1
Print "The current system date is: "Print DateOutput:The current system date is: 1/14/2002
DateAdd
Returns a date to which a specified time interval has been added
The DateAdd function returns a date to which a specified time interval has been added.
Syntax
DateAdd(interval,number,date)
Parameter

Description
interval
Required. The interval you want to add
Can take the following values:
yyyy - Year
q - Quarter
m - Month
y - Day of year
d - Day
w - Weekday
ww - Week of year
h - Hour
n - Minute
s - Second
number
Required. The number of interval you want to add. Can either be positive, for dates in the future, or
negative, for dates in the past
date
Required. Variant or literal representing the date to which interval is added
Example 1
'Add one month to January 31, 2000Print DateAdd("m",1,"31-Jan-00")Output:2/29/2000
Print DateAdd("m",1,"31-Jan-00")
Example 2
'Add one month to January 31, 2001Print DateAdd("m",1,"31-Jan-01")Output:2/28/2001
Print DateAdd("m",-1,"31-Jan-01")
Example 3
'Subtract one month from January 31, 2001Print DateAdd("m",-1,"31-Jan-01")Output:12/31/2000
DateDiff
Returns the number of intervals between two dates
The DateDiff function returns the number of intervals between two dates.
Syntax
DateDiff(interval,date1,date2[,firstdayofweek[,firstweekofyear]])
date1,date2
Required. Date expressions. Two dates you want to use in the calculation
firstdayofweek
Optional. Specifies the day of the week.
Can take the following values:
0 = vbUseSystemDayOfWeek - Use National Language Support (NLS) API setting
1 = vbSunday - Sunday (default)
2 = vbMonday - Monday
3 = vbTuesday - Tuesday

4 = vbWednesday - Wednesday
5 = vbThursday - Thursday
6 = vbFriday - Friday
7 = vbSaturday - Saturday
firstweekofyear
Optional. Specifies the first week of the year.
Can take the following values:
0 = vbUseSystem - Use National Language Support (NLS) API setting
1 = vbFirstJan1 - Start with the week in which January 1 occurs (default)
2 = vbFirstFourDays - Start with the week that has at least four days in the new year
3 = vbFirstFullWeek - Start with the first full week of the new year
Example 1
Print Date Print DateDiff("m",Date,"12/31/2002")Print DateDiff("d",Date,"12/31/2002") Print
DateDiff("n",Date,"12/31/2002")Output:1/14/200211351505440
Example 2
Print Date'Note that in the code below'is date1>date2Print
DateDiff("d","12/31/2002",Date)Output:1/14/2002-351
Example 3
'How many weeks (start on Monday),'are left between the current date and 10/10/2002Print Date Print
DateDiff("w",Date,"10/10/2002",vbMonday)Output:1/14/200238
DatePart
Returns the specified part of a given date
The DatePart function returns the specified part of a given date.
Syntax
DatePart(interval,date[,firstdayofweek[,firstweekofyear]])
Example 1
Print Date Print DatePart("d",Date)Output:1/14/200214
Example 2
Print DatePrint DatePart("w",Date)Output:1/14/20022
DateSerial
Returns the date for a specified year, month, and day
The DateSerial function returns a Variant of subtype Date for a specified year, month, and day.
Syntax
DateSerial(year,month,day)
Parameter
Description
year
Required. A number between 100 and 9999, or a numeric expression. Values between 0 and 99 are

interpreted as the years 19001999. For all other year arguments, use a complete four-digit year
month
Required. Any numeric expression
day
Required. Any numeric expression
Example 1
Print DateSerial(1996,2,3)Print DateSerial(1990-20,9-2,1-1)Output:2/3/19966/30/1970
DateValue
Returns a date
The DateValue function returns a type Date.
Note: If the year part of date is omitted this function will use the current year from the computer's
system date.
Note: If the date parameter includes time information it will not be returned. However, if date includes
invalid time information, a run-time error will occur.
Syntax
DateValue(date)
Parameter
Description
date
Required. A date from January 1, 100 through December 31, 9999 or any expression that can represent
a date, a time, or both a date and time
Example 1
Print DateValue("31-Jan-02")Print DateValue("31-Jan")Print DateValue("31-Jan-02 2:39:49
AM")Output:1/31/20021/31/20021/31/2002
Day
Returns a number that represents the day of the month (between 1 and 31, inclusive)
The Day function returns a number between 1 and 31 that represents the day of the month.
Syntax
Day(date)
Parameter
Description
date
Required. Any expression that can represent a date
Example 1
Print DatePrint Day(Date)Output:1/14/200214
FormatDateTime
Returns an expression formatted as a date or time

The FormatDateTime function formats and returns a valid date or time expression.
Syntax
FormatDateTime(date,format)
Parameter
Description
date
Required. Any valid date expression (like Date() or Now())
format
Optional. A Format value that specifies the date/time format to use
Example 1
Print The current date is: "Print FormatDateTime(Date())Output:The current date is: 2/22/2001
Example 2
Print The current date is: "Print FormatDateTime(Date(),1)Output:The current date is: Thursday,
February 22, 2001
Example 3
Print The current date is: "Print FormatDateTime(Date(),2)Output:The current date is: 2/22/2001
Format Values
Constant
Value
Description
vbGeneralDate
0
Display a date in format mm/dd/yy. If the date parameter is Now(), it will also return the time, after the
date
vbLongDate
1
Display a date using the long date format: weekday, month day, year
vbShortDate
2
Display a date using the short date format: like the default (mm/dd/yy)
vbLongTime
3
Display a time using the time format: hh:mm:ss PM/AM
vbShortTime
4
Display a time using the 24-hour format: hh:mm
Hour
Returns a number that represents the hour of the day (between 0 and 23, inclusive)
The Hour function returns a number between 0 and 23 that represents the hour of the day.

Syntax
Hour(time)
Parameter
Description
time
Required. Any expression that can represent a time
Example 1
Print Now Print Hour(Now)Output:1/15/2002 10:07:47 AM10
Example 2
Print Hour(Time)Output:10
IsDate
Returns a Boolean value that indicates if the evaluated expression can be converted to a date
The IsDate function returns a Boolean value that indicates if the evaluated expression can be converted
to a date. It returns True if the expression is a date or can be converted to a date; otherwise, it returns
False.
Note: The IsDate function uses local setting to determine if a string can be converted to a date
("January" is not a month in all languages.)
Syntax
IsDate(expression)
Parameter
Description
expression
Required. The expression to be evaluated
Example 1
Print IsDate("April 22, 1947")Print IsDate(#11/11/01#)Print IsDate("#11/11/01#")Print IsDate("Hello
World!")Output:TrueTrueFalseFalse
Minute
Returns a number that represents the minute of the hour (between 0 and 59, inclusive)
The Minute function returns a number between 0 and 59 that represents the minute of the hour.
Syntax
Minute(time)
Parameter
Description
time
Required. Any expression that can represent a time
Example 1
Print Now Print Minute(Now)Output:1/15/2002 10:34:39 AM34

Example 2
Print Minute(Time)Output:34
Month
Returns a number that represents the month of the year (between 1 and 12, inclusive)
The Month function returns a number between 1 and 12 that represents the month of the year.
Syntax
Month(date)
Parameter
Description
date
Required. Any expression that can represent a date
Example 1
Print DatePrint Month(Date)Output:1/15/20021
MonthName
Returns the name of a specified month
The MonthName function returns the name of the specified month.
Syntax
MonthName(month[,abbreviate])
Parameter
Description
month
Required. Specifies the number of the month (January is 1, February is 2, etc.)
abbreviate
Optional. A Boolean value that indicates if the month name is to be abbreviated. Default is False
Example 1
Print MonthName(8)Output:August
Example 2
Print MonthName(8,true)Output:Aug
Now
Returns the current system date and time
The Now function returns the current date and time according to the setting of your computer's system
date and time.
Syntax
Now
Example 1
Print NowOutput:1/15/2002 10:52:15 AM

Second
Returns a number that represents the second of the minute (between 0 and 59, inclusive)
The Second function returns a number between 0 and 59 that represents the second of the minute.
Syntax
Second(time)
Parameter
Description
time
Required. Any expression that can represent a time
Example 1
Print Now Print Second(Now)Output:1/15/2002 10:55:51 AM51
Example 2
Print Second(Time)Output:51
Time
Returns the current system time
The Time function returns the current system time.
Syntax
Time
Example 1
Print TimeOutput:11:07:27 AM
Timer
Returns the number of seconds since 12:00 AM
The Timer function returns the number of seconds since 12:00 AM.
Syntax
Timer
Example 1
Print TimePrint TimerOutput:11:11:13 AM40273.2
TimeSerial
Returns the time for a specific hour, minute, and second
The TimeSerial function returns the time for a specific hour, minute, and second.
Syntax
TimeSerial(hour,minute,second)
Parameter
Description
hour
Required. A number between 0 and 23, or a numeric expression
minute

Required. Any numeric expression


second
Required. Any numeric expression
Example 1
Print TimeSerial(23,2,3)Print TimeSerial(0,9,11) Print TimeSerial(14+2,9-2,1-1)Output:11:02:03
PM12:09:11 AM4:07:00 PM
TimeValue
Returns a time
The TimeValue function returns a Variant of subtype Date that contains the time.
Syntax
TimeValue(time)
Parameter
Description
time
Required. A time from 0:00:00 (12:00:00 A.M.) to 23:59:59 (11:59:59 P.M.) or any expression that
represents a time in that range
Example 1
Print TimeValue("5:55:59 PM")Print TimeValue(#5:55:59 PM#)Print TimeValue("15:34")Output:5:55:59
PM5:55:59 PM3:34:00 PM
Weekday
Returns a number that represents the day of the week (between 1 and 7, inclusive)
The Weekday function returns a number between 1 and 7, that represents the day of the week.
Syntax
Weekday(date[,firstdayofweek])
Parameter
Description
date
Required. The date expression to evaluate
firstdayofweek
Optional. Specifies the first day of the week.
Can take the following values:
0 = vbUseSystemDayOfWeek - Use National Language Support (NLS) API setting
1 = vbSunday - Sunday (default)
2 = vbMonday - Monday
3 = vbTuesday - Tuesday
4 = vbWednesday - Wednesday
5 = vbThursday - Thursday
6 = vbFriday - Friday

7 = vbSaturday - Saturday
Example 1
Print DatePrint Weekday(Date)Output:1/15/20023
WeekdayName
Returns the weekday name of a specified day of the week
The WeekdayName function returns the weekday name of a specified day of the week.
Syntax
WeekdayName(weekday[,abbreviate[,firstdayofweek]])
Parameter
Description
weekday
Required. The number of the weekday
abbreviate
Optional. A Boolean value that indicates if the weekday name is to be abbreviated
Example 1
Print WeekdayName(3)Output:Tuesday
Example 2
Print DatePrint Weekday(Date)Print WeekdayName(Weekday(Date)Output:1/15/20023Tuesday
Example 3
Print Date Print Weekday(Date)Print WeekdayName(Weekday(Date),true)Output:1/15/20023Tue
Year
Returns a number that represents the year
The Year function returns a number that represents the year.
Syntax
Year(date)
Parameter
Description
date
Required. Any expression that can represent a date
Example 1
Print Date Print Year(Date)Output:1/15/20022002
Conversion Functions

Asc Converts the first letter in a string to ANSI code


The Asc function converts the first letter in a string to ANSI code, and returns the result.
Syntax

Asc(string)
Parameter
Description
string
Required. A string expression. Cannot be an empty string!
Example 1
Print Asc("A")Print Asc("F")Output:6570
Example 2
Print Asc("a")Print Asc("f")Output:97102
Example 3
Print Asc("W")Print Asc("W3Schools.com")Output:8787
Example 4
Print Asc("2")Print Asc("#")Output:5035
CBool Converts an expression to a variant of subtype Boolean
The CBool function converts an expression to type Boolean.
Syntax
CBool(expression)
Parameter
Description
expression
Required. Any valid expression. A nonzero value returns True, zero returns False. A run-time error occurs
if the expression can not be interpreted as a numeric value
Example 1
dim a,ba=5b=10print CBool(a)print CBool(b)Output:TrueTrue
CByte Converts an expression to a variant of subtype Byte
The CByte function converts an expression to type Byte.
Syntax
CByte(expression)
Parameter
Description
expression
Required. Any valid expression
Example 1
dim aa=134.345print CByte(a)Output:134
Example 2
dim aa=14.345455print CByte(a)Output:14

CCur Converts an expression to a variant of subtype Currency


The CCur function converts an expression to type Currency.
Syntax
CCur(expression)
Parameter
Description
expression
Required. Any valid expression
Example 1
dim aa=134.345print CCur(a)Output:134.345
Example 2
dim aa=1411111111.345455'NB! This function rounds off to 4 decimal placesPrint
CCur(a)Output:1411111111.3455
CDate Converts a valid date and time expression to the variant of subtype Date
The CDate function converts a valid date and time expression to type Date, and returns the result.
Tip: Use the IsDate function to determine if date can be converted to a date or time.
Note: The IsDate function uses local setting to determine if a string can be converted to a date
("January" is not a month in all languages.)
Syntax
CDate(date)
Parameter
Description
date
Required. Any valid date expression (like Date() or Now())
Example 1
d="April 22, 2001"if IsDate(d) then print CDate(d)end ifOutput:2/22/01
Example 2
d=#2/22/01#if IsDate(d) then print CDate(d)end ifOutput:2/22/01
Example 3
d="3:18:40 AM"if IsDate(d) then print CDate(d)end ifOutput:3:18:40 AM
CDbl Converts an expression to a variant of subtype Double
The CDbl function converts an expression to type Double.
Syntax
CDbl(expression)
Parameter
Description
expression

Required. Any valid expression


Example 1
dim aa=134.345 print CDbl(a)Output:134.345
Example 2
dim aa=14111111113353355.345455 print CDbl(a)Output:1.41111111133534E+16
Chr Converts the specified ANSI code to a character
The Chr function converts the specified ANSI character code to a character.
Note: The numbers from 0 to 31 represents nonprintable ASCII codes, i.e. Chr(10) will return a linefeed
character.
Syntax
Chr(charcode)
Parameter
Description
charcode
Required. A number that identifies a character
Example 1
Print Chr(65)Print Chr(97)Output:Aa
Example 2
Print Chr(37)Print Chr(45)Output:%Example 3
Print Chr(50)Print Chr(35)Output:2#
CInt Converts an expression to a variant of subtype Integer
The CInt function converts an expression to type Integer.
Note: The value must be a number between -32768 and 32767.
Syntax
CInt(expression)
Parameter
Description
expression
Required. Any valid expression
Example 1
dim aa=134.345print CInt(a)Output:134
Example 2
dim aa=-30000.24print CInt(a)Output:-30000
CLng Converts an expression to a variant of subtype Long
The CLng function converts an expression to type Long.
Note: The value must be a number between -2147483648 and 2147483647.

Syntax
CLng(expression)
Parameter
Description
expression
Required. Any valid expression
Example 1
dim a,ba=23524.45b=23525.55print CLng(a)print CLng(b)Output:2352423526
CSng Converts an expression to a variant of subtype Single
The CSng function converts an expression to type Single.
Syntax
CSng(expression)
Parameter
Description
expression
Required. Any valid expression
Example 1
dim a,ba=23524.4522b=23525.5533print CSng(a)print CSng(b)Output:23524.4523525.55
CStr Converts an expression to a variant of subtype String
The CStr function converts an expression to type String.
Syntax
CStr(expression)
Parameter
Description
expression
Required. Any valid expression
If expression is:
Boolean - then the CStr function will return a string containing true or false.
Date - then the CStr function will return a string that contains a date in the short-date format.
Null - then a run-time error will occur.
Empty - then the CStr function will return an empty string ("").
Error - then the CStr function will return a string that contains the word "Error" followed by an error
number.
Other numeric - then the CStr function will return a string that contains the number.
Example 1
dim aa=falseprint CStr(a)Output:false
Example 2

dim aa=#01/01/01#print CStr(a)Output:1/1/2001


Hex Returns the hexadecimal value of a specified number
The Hex function returns a string that represents the hexadecimal value of a specified number.
Note: If number is not a whole number, it is rounded to the nearest whole number before being
evaluated.
Syntax
Hex(number)
Parameter
Description
number
Required. Any valid expression
If number is:
Null - then the Hex function returns Null.
Empty - then the Hex function returns zero (0).
Any other number - then the Hex function returns up to eight hexadecimal characters.
Example 1
print Hex(3)print Hex(5)print Hex(9)print Hex(10)print Hex(11)print Hex(12)print Hex(400)print
Hex(459)print Hex(460)Output:359ABC1901CB1CC
Oct Returns the octal value of a specified number
The Oct function returns a string that represents the octal value of a specified number.
Note: If number is not already a whole number, it is rounded to the nearest whole number before being
evaluated.
Syntax
Oct(number)
Parameter
Description
Number
Required. Any valid expression
If number is:
Null - then the Oct function returns Null.
Empty - then the Oct function returns zero (0).
Any other number - then the Oct function returns up to 11 octal characters.
Example 1
print Oct(3)print Oct(5)print Oct(9)print Oct(10) print Oct(11)print Oct(12)print Oct(400)print
Oct(459)print Oct(460)Output:3511121314620713714
Format Functions

Function
FormatCurrency Returns an expression formatted as a currency value
The FormatCurrency function returns an expression formatted as a currency value using the currency
symbol defined in the computer's control panel.
Syntax
FormatCurrency(Expression[,NumDigAfterDec[,IncLeadingDig[,UseParForNegNum[,GroupDig]]]])
Parameter
Description
Expression
Required. The expression to be formatted
NumDigAfterDec
Optional. Indicates how many places to the right of the decimal are displayed. Default is -1 (the
computer's regional settings are used)
IncLeadingDig
Optional. Indicates whether or not a leading zero is displayed for fractional values:
-2 = TristateUseDefault - Use the computer's regional settings
-1 = TristateTrue - True
0 = TristateFalse - False
UseParForNegNum
Optional. Indicates whether or not to place negative values within parentheses:
-2 = TristateUseDefault - Use the computer's regional settings
-1 = TristateTrue - True
0 = TristateFalse - False
GroupDig
Optional. Indicates whether or not numbers are grouped using the group delimiter specified in the
computer's regional settings:
-2 = TristateUseDefault - Use the computer's regional settings
-1 = TristateTrue - True
0 = TristateFalse - False
Example 1
print FormatCurrency(20000)Output:$20,000.00
Example 2
print FormatCurrency(20000.578,2)Output:$20,000.58
Example 3
print FormatCurrency(20000.578,2,,,0)Output:$20000.58
FormatDateTime Returns an expression formatted as a date or time
The FormatDateTime function formats and returns a valid date or time expression.
Syntax
FormatDateTime(date,format)

Parameter
Description
date
Required. Any valid date expression (like Date() or Now())
format
Optional. A Format value that specifies the date/time format to use
Example 1
print "The current date is: "print FormatDateTime(Date())Output:The current date is: 2/22/2001
Example 2
Print "The current date is: "print FormatDateTime(Date(),1)Output:The current date is: Thursday,
February 22, 2001
Example 3
print "The current date is: "print FormatDateTime(Date(),2)Output:The current date is: 2/22/2001
Format Values
Constant
Value
Description
vbGeneralDate
0
Display a date in format mm/dd/yy. If the date parameter is Now(), it will also return the time, after the
date
vbLongDate
1
Display a date using the long date format: weekday, month day, year
vbShortDate
2
Display a date using the short date format: like the default (mm/dd/yy)
vbLongTime
3
Display a time using the time format: hh:mm:ss PM/AM
vbShortTime
4
Display a time using the 24-hour format: hh:mm
FormatNumber Returns an expression formatted as a number
The FormatNumber function returns an expression formatted as a number.
Syntax
FormatNumber(Expression[,NumDigAfterDec[,IncLeadingDig[,UseParForNegNum[,GroupDig]]]])

Parameter
Description
expression
Required. The expression to be formatted
NumDigAfterDec
Optional. Indicates how many places to the right of the decimal are displayed. Default is -1 (the
computer's regional settings are used)
IncLeadingDig
Optional. Indicates whether or not a leading zero is displayed for fractional values:
-2 = TristateUseDefault - Use the computer's regional settings
-1 = TristateTrue - True
0 = TristateFalse - False
UseParForNegNum
Optional. Indicates whether or not to place negative values within parentheses:
-2 = TristateUseDefault - Use the computer's regional settings
-1 = TristateTrue - True
0 = TristateFalse - False
GroupDig
Optional. Indicates whether or not numbers are grouped using the group delimiter specified in the
computer's regional settings:
-2 = TristateUseDefault - Use the computer's regional settings
-1 = TristateTrue - True
0 = TristateFalse - False
Example 1
print (FormatNumber(20000))Output:20,000.00
Example 2
print FormatNumber(20000.578,2)Output:20,000.58
Example 3
print FormatNumber(20000.578,2,,,0)Output:20000.58
FormatPercent Returns an expression formatted as a percentage
The FormatPercent function returns an expression formatted as a percentage (multiplied by 100) with a
trailing % character.
Syntax
FormatPercent(Expression[,NumDigAfterDec[,IncLeadingDig[,UseParForNegNum[,GroupDig]]]])
Parameter
Description
expression
Required. The expression to be formatted
NumDigAfterDec
Optional. Indicates how many places to the right of the decimal are displayed. Default is -1 (the

computer's regional settings are used)


IncLeadingDig
Optional. Indicates whether or not a leading zero is displayed for fractional values:
-2 = TristateUseDefault - Use the computer's regional settings
-1 = TristateTrue - True
0 = TristateFalse - False
UseParForNegNum
Optional. Indicates whether or not to place negative values within parentheses:
-2 = TristateUseDefault - Use the computer's regional settings
-1 = TristateTrue - True
0 = TristateFalse - False
GroupDig
Optional. Indicates whether or not numbers are grouped using the group delimiter specified in the
computer's regional settings:
-2 = TristateUseDefault - Use the computer's regional settings
-1 = TristateTrue - True
0 = TristateFalse - False
Example 1
'How many percent is 6 of 345?print FormatPercent(6/345)Output:1.74%
Example 2
'How many percent is 6 of 345?print FormatPercent(6/345,1)Output:1.7%
Math Functions
Function
Abs Returns the absolute value of a specified number
The Abs function returns the absolute value of a specified number.
Note: If the number parameter contains Null, Null will be returned
Note: If the number parameter is an uninitialized variable, zero will be returned.
Syntax
Abs(number)
Parameter
Description
number
Required. A numeric expression
Example 1
print Abs(1)print Abs(-1)Output:11
Example 2
print Abs(48.4)print Abs(-48.4)Output:48.448.4
Atn Returns the arctangent of a specified number

The Atn function returns the arctangent of a specified number.


Syntax
Atn(number)
Parameter
Description
number
Required. A numeric expression
Example 1
print Atn(89)Output:1.55956084453693
Example 2
print Atn(8.9)Output:1.45890606062322
Example 3
'calculate the value of pidim pipi=4*Atn(1)print piOutput:3.14159265358979
Cos Returns the cosine of a specified number (angle)
The Cos function returns the cosine of a specified number (angle).
Syntax
Cos(number)
Parameter
Description
Number
Required. A numeric expression that expresses an angle in radians
Example 1
print Cos(50.0)Output:0.964966028492113
Example 2
print Cos(-50.0)Output:0.964966028492113
Exp Returns e raised to a power
The Exp function returns e raised to a power.
Note: The value of number cannot exceed 709.782712893.
Tip: Also look at the Log function.
Syntax
Exp(number)
Parameter
Description
number
Required. A valid numeric expression
Example 1
print Exp(6.7)Output:812.405825167543

Example 2
print Exp(-6.7)Output:1.23091190267348E-03
Hex Returns the hexadecimal value of a specified number
The Hex function returns a string that represents the hexadecimal value of a specified number.
Note: If number is not a whole number, it is rounded to the nearest whole number before being
evaluated.
Syntax
Hex(number)
Parameter
Description
number
Required. Any valid expression
If number is:
Null - then the Hex function returns Null.
Empty - then the Hex function returns zero (0).
Any other number - then the Hex function returns up to eight hexadecimal characters.
Example 1
print Hex(3)print Hex(5) print Hex(9)print Hex(10)print Hex(11)print Hex(12)print Hex(400)print
Hex(459)print Hex(460)Output:359ABC1901CB1CC
Int Returns the integer part of a specified number
The Int function returns the integer part of a specified number.
Note: If the number parameter contains Null, Null will be returned.
Tip: Also look at the Fix function.
Syntax
Int(number)
Parameter
Description
Number
Required. A valid numeric expression
Example 1
print Int(6.83227)Output:6
Example 2
print Int(6.23443)Output:6
Example 3
print Int(-6.13443)Output:-7
Example 4
print Int(-6.93443)Output:-7

Fix Returns the integer part of a specified number


The Fix function returns the integer part of a specified number.
Note: If the number parameter contains Null, Null will be returned.
Tip: Also look at the Int function.
Syntax
Fix(number)
Parameter
Description
number
Required. A valid numeric expression
Example 1
print Fix(6.83227)Output:6
Example 2
print Fix(6.23443)Output:6
Example 3
Print Fix(-6.13443)Output:-6
Example 4
print Fix(-6.93443)Output:-6
Log Returns the natural logarithm of a specified number
The Log function returns the natural logarithm of a specified number. The natural logarithm is the
logarithm to the base e.
Note: Negative values are not allowed.
Tip: Also look at the Exp function.
Syntax
Log(number)
Parameter
Description
number
Required. A valid numeric expression > 0
Example 1
print Log(38.256783227)Output:3.64432088381777
Oct Returns the octal value of a specified number
The Oct function returns a string that represents the octal value of a specified number.
Note: If number is not already a whole number, it is rounded to the nearest whole number before being
evaluated.
Syntax
Oct(number)

Parameter
Description
number
Required. Any valid expression
If number is:
Null - then the Oct function returns Null.
Empty - then the Oct function returns zero (0).
Any other number - then the Oct function returns up to 11 octal characters.
Example 1
print Oct(3)print Oct(5)print Oct(9) print Oct(10) print Oct(11)print Oct(12) print Oct(400)print
Oct(459)print Oct(460)Output:3511121314620713714
Rnd Returns a random number less than 1 but greater or equal to 0
The Rnd function returns a random number. The number is always less than 1 but greater or equal to 0.
Syntax
Rnd[(number)]
Parameter
Description
number
Optional. A valid numeric expression
If number is:
<0 - Rnd returns the same number every time
>0 - Rnd returns the next random number in the sequence
=0 - Rnd returns the most recently generated number
Not supplied - Rnd returns the next random number in the sequence
Example 1
print RndOutput:0.7055475
Example 2
'If you refresh the page,'using the code in example 1,'the SAME random number will show over and
over.'Use the Randomize statement generate a new random number'each time the page is
reloaded!Randomizeprint RndOutput:0.4758112
Example 3
'Here is how to produce random integers in a'given range:dim max,minmax=100min=1print Int((maxmin+1)*Rnd+min)Output:71
Sgn Returns an integer that indicates the sign of a specified number
The Sgn function returns an integer that indicates the sign of a specified number.
Syntax
Sgn(number)
Parameter

Description
number
Required. A valid numeric expression
If number is:
>0 - Sgn returns 1
=0 - Sgn returns 0
<0 - Sgn returns -1
Example 1
print Sgn(15)Output:1
Example 2
print Sgn(-5.67)Output:-1
Example 3
print Sgn(0)Output:0
Sin Returns the sine of a specified number (angle)
The Sin function returns the sine of a specified number (angle).
Syntax
Sin(number)
Parameter
Description
Number
Required. A valid numeric expression that expresses an angle in radians
Example 1
print Sin(47)Output:0.123573122745224
Example 2
print Sin(-47)Output:-0.123573122745224
Sqr Returns the square root of a specified number
The Sqr function returns the square root of a number.
Note: The number parameter cannot be a negative value.
Syntax
Sqr(number)
Parameter
Description
Number
Required. A valid numeric expression >= 0
Example 1
print Sqr(9)Output:3
Example 2
print Sqr(0)Output:0

Example 3
print Sqr(47)Output:6.85565460040104
Tan Returns the tangent of a specified number (angle)
The Tan function returns the tangent of a specified number (angle).
Syntax
Tan(number)
Parameter
Description
Number
Required. A valid numeric expression that expresses an angle in radians
Example 1
print Tan(40)Output:-1.1172149309239
Example 2
print Tan(40)Output:1.1172149309239
Array Functions
Function
Array Returns a variant containing an array
The Array function returns a variant containing an array.
Note: The first element in the array is zero.
Syntax
Array(arglist)
Parameter
Description
Arglist
Required. A list (separated by commas) of values that is the elements in the array
Example 1
dim aa=Array(5,10,15,20)print a(3)Output:20
Example 2
dim aa=Array(5,10,15,20)print a(0)Output:5
Filter Returns a zero-based array that contains a subset of a string array based on a filter criteria
The Filter function returns a zero-based array that contains a subset of a string array based on a filter
criteria.
Note: If no matches of the value parameter are found, the Filter function will return an empty array.
Note: If the parameter inputstrings is Null or is NOT a one-dimensional array, an error will occur.
Syntax
Filter(inputstrings,value[,include[,compare]])

Parameter
Description
Inputstrings
Required. A one-dimensional array of strings to be searched
Value
Required. The string to search for
Include
Optional. A Boolean value that indicates whether to return the substrings that include or exclude value.
True returns the subset of the array that contains value as a substring. False returns the subset of the
array that does not contain value as a substring. Default is True.
compare
Optional. Specifies the string comparison to use.
Can have one of the following values:
0 = vbBinaryCompare - Perform a binary comparison
1 = vbTextCompare - Perform a textual comparison
Example 1
dim
a(5),ba(0)="Saturday"a(1)="Sunday"a(2)="Monday"a(3)="Tuesday"a(4)="Wednesday"b=Filter(a,"n")prin
t b(0)print b(1)print (b(2)Output:SundayMondayWednesday
Example 2
dim
a(5),ba(0)="Saturday"a(1)="Sunday"a(2)="Monday"a(3)="Tuesday"a(4)="Wednesday"b=Filter(a,"n",false
)print b(0) print b(1)print b(2)Output:SaturdayTuesday
IsArray Returns a Boolean value that indicates whether a specified variable is an array
The IsArray function returns a Boolean value that indicates whether a specified variable is an array. If
the variable is an array, it returns True, otherwise, it returns False.
Syntax
IsArray(variable)
Parameter
Description
variable
Required. Any variable
Example 1
dim a(5)a(0)="Saturday"a(1)="Sunday"a(2)="Monday"a(3)="Tuesday"a(4)="Wednesday"print
IsArray(a)Output:True
Example 2
dim aa="Saturday"print IsArray(a)Output:False
Join Returns a string that consists of a number of substrings in an array

The Join function returns a string that consists of a number of substrings in an array.
Syntax
Join(list[,delimiter])
Parameter
Description
list
Required. A one-dimensional array that contains the substrings to be joined
delimiter
Optional. The character(s) used to separate the substrings in the returned string. Default is the space
character
Example 1
dim
a(5),ba(0)="Saturday"a(1)="Sunday"a(2)="Monday"a(3)="Tuesday"a(4)="Wednesday"b=Filter(a,"n")prin
t join(b)Output:Sunday Monday Wednesday
Example 2
dim
a(5),ba(0)="Saturday"a(1)="Sunday"a(2)="Monday"a(3)="Tuesday"a(4)="Wednesday"b=Filter(a,"n")prin
t join(b,", ")Output:Sunday, Monday, Wednesday
LBound Returns the smallest subscript for the indicated dimension of an array
The LBound function returns the smallest subscript for the indicated dimension of an array.
Note: The LBound for any dimension is ALWAYS 0.
Tip: Use the LBound function with the UBound function to determine the size of an array.
Syntax
LBound(arrayname[,dimension])
Parameter
Description
arrayname
Required. The name of the array variable
dimension
Optional. Which dimension's lower bound to return. 1 = first dimension, 2 = second dimension, and so
on. Default is 1
Example 1
dim
a(10)a(0)="Saturday"a(1)="Sunday"a(2)="Monday"a(3)="Tuesday"a(4)="Wednesday"a(5)="Thursday"pri
nt UBound(a)print LBound(a)Output:100
Split Returns a zero-based, one-dimensional array that contains a specified number of substrings
The Split function returns a zero-based, one-dimensional array that contains a specified number of
substrings.

Syntax
Split(expression[,delimiter[,count[,compare]]])
Parameter
Description
expression
Required. A string expression that contains substrings and delimiters
delimiter
Optional. A string character used to identify substring limits. Default is the space character
count
Optional. The number of substrings to be returned. -1 indicates that all substrings are returned
compare
Optional. Specifies the string comparison to use.
Can have one of the following values:
0 = vbBinaryCompare - Perform a binary comparison
1 = vbTextCompare - Perform a textual comparison
Example 1
dim txt,atxt="Hello World!"a=Split(txt)print a(0)print a(1)Output:HelloWorld!
UBound Returns the largest subscript for the indicated dimension of an array
The UBound function returns the largest subscript for the indicated dimension of an array.
Tip: Use the UBound function with the LBound function to determine the size of an array.
Syntax
UBound(arrayname[,dimension])
Parameter
Description
arrayname
Required. The name of the array variable
dimension
Optional. Which dimension's upper bound to return. 1 = first dimension, 2 = second dimension, and so
on. Default is 1
Example 1
dim
a(10)a(0)="Saturday"a(1)="Sunday"a(2)="Monday"a(3)="Tuesday"a(4)="Wednesday"a(5)="Thursday"pri
nt UBound(a)print LBound(a)Output:100
String Functions
Function
InStr Returns the position of the first occurrence of one string within another. The search begins at the
first character of the string

InStrRev Returns the position of the first occurrence of one string within another. The search begins at
the last character of the string
LCase Converts a specified string to lowercase
Left Returns a specified number of characters from the left side of a string
Len Returns the number of characters in a string
LTrim Removes spaces on the left side of a string
RTrim Removes spaces on the right side of a string
Trim Removes spaces on both the left and the right side of a string
Mid Returns a specified number of characters from a string
Replace Replaces a specified part of a string with another string a specified number of times
Right Returns a specified number of characters from the right side of a string
Space Returns a string that consists of a specified number of spaces
StrComp Compares two strings and returns a value that represents the result of the comparison
String Returns a string that contains a repeating character of a specified length
StrReverse Reverses a string
UCase Converts a specified string to uppercase
Other Functions
Function
CreateObject Creates an object of a specified type
Eval Evaluates an expression and returns the result
GetLocale Returns the current locale ID
GetObject Returns a reference to an automation object from a file
GetRef Allows you to connect a VBScript procedure to a DHTML event on your pages
InputBox Displays a dialog box, where the user can write some input and/or click on a button, and
returns the contents
IsEmpty Returns a Boolean value that indicates whether a specified variable has been initialized or not
IsNull Returns a Boolean value that indicates whether a specified expression contains no valid data (Null)
IsNumeric Returns a Boolean value that indicates whether a specified expression can be evaluated as a
number
IsObject Returns a Boolean value that indicates whether the specified expression is an automation
object
LoadPicture Returns a picture object. Available only on 32-bit platforms
MsgBox Displays a message box, waits for the user to click a button, and returns a value that indicates
which button the user clicked
RGB Returns a number that represents an RGB color value
Round Rounds a number
ScriptEngine Returns the scripting language in use
ScriptEngineBuildVersion Returns the build version number of the scripting engine in use
ScriptEngineMajorVersion Returns the major version number of the scripting engine in use
ScriptEngineMinorVersion Returns the minor version number of the scripting engine in use

SetLocale Sets the locale ID and returns the previous locale ID


TypeName Returns the subtype of a specified variable
VarType Returns a value that indicates the subtype of a specified variable
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 11:34 PM 1
comments
Software Testing Methods
Software Testing
Software Testing is an investigation conducted to provide stakeholders with information about the
quality of the product or service under test, with respect to the context in which it is intended to
operate. This includes, but is not limited to, the process of executing a program or application with the
intent of finding software bugs.
Testing methods
Software testing methods are traditionally divided into
Black Box Testing,
White Box Testing
Gray Box Testing.
These two approaches are used to describe the point of view that a test engineer takes when designing
test cases.
Black box testing
Black box testing treats the software as a black box without any knowledge of internal implementation.
Black box testing methods include
A. Equivalence partitioning
A software testing technique that involves identifying a small set of representative input values that
invoke as many different input conditions as possible.
EX: Credit card limit ($10,000 and $15000)
Less than- 10,000 invalid
Equal to ($10,000 and not as greater as 15000) valid
$15,000 or greater invalid
B. Boundary value analysis
To set up boundary value analysis test cases, the tester first determines which boundaries are at the
interface of a software component. This is done by applying the equivalence partitioning technique
C. All-pairs testing
All-pairs testing or pair wise testing is a combinatorial software testing method that, for each pair of
input parameters to a system (typically, a software algorithm), tests all possible discrete combinations of
those parameters. Using carefully chosen test vectors, this can be done much faster than an exhaustive

search of all combinations of all parameters, by "parallelizing" the tests of parameter pairs. The number
of tests is typically O (nm), where n and m are the number of possibilities for each of the two
parameters with the most choices.
D. Fuzz testing
Fuzz testing; fuzzing; Robustness Testing or Negative Testing is a software testing technique that
provides random data ("fuzz") to the inputs of a program. If the program fails (for example, by crashing,
or by failing built-in code assertions), the defects can be noted.
E. Model-based testing
Model-based testing is software testing in which test cases is derived in whole or in part from a model
that describes some (usually functional) aspects of the system under test (SUT).
G. Exploratory testing
Exploratory testing is a method of manual testing that is concisely described as simultaneous learning,
test design and test execution.
Specification-based testing.
H. Specification Based Testing refers to the process of testing a program based on what its specification
says its behavior should be. In particular, we can develop test cases based on the specification of the
program's behavior, without seeing an implementation of the program. Furthermore, we can develop
test cases before the program even exists!
White box testing
White box testing, by contrast to black box testing, is when the tester has access to the internal data
structures and algorithms (and the code that implement these)

White box testing


The following types of white box testing exist:
A. Code coverage
Creating tests to satisfy some criteria of code coverage. For example, the test designer can create tests
to cause all statements in the program to be executed at least once.
B. mutation testing
Mutation testing (or Mutation analysis) is a method of software testing, which involves modifying
program's source code in small ways. These, so-called mutations, are based on well-defined mutation
operators that either mimic typical user mistakes (such as using the wrong operator or variable name) or
force the creation of valuable tests (such as driving each expression to zero). The purpose is to help the
tester develop effective tests or locate weaknesses in the test data used for the program or in sections
of the code that are seldom or never accessed during execution.
C. Fault injection methods.
Fault injection is a technique for improving the coverage of a test by introducing faults in order to test

code paths, in particular error handling code paths that might otherwise rarely be followed. It is often
used with stress testing and is widely considered to be an important part of developing robust software
Static testing White box testing includes all static testing.
D. Static testing
This is a form of software testing where the software isn't actually used. This is in contrast to dynamic
testing. It is generally not detailed testing, but checks mainly for the sanity of the code, algorithm, or
document. It is primarily syntax checking of the code or and manually reading of the code or document
to find errors. This type of testing can be used by the developer who wrote the code, in isolation. Code
reviews, inspections and walkthroughs are also used.
Grey Box Testing
In recent years the term grey box testing has come into common usage. This involves having access to
internal data structures and algorithms for purposes of designing the test cases, but testing at the user,
or black-box level.
Manipulating input data and formatting output do not qualify as grey-box because the input and output
are clearly outside of the black-box we are calling the software under test. This is particularly important
when conducting integration testing between two modules of code written by two different developers,
where only the interfaces are exposed for test. Grey box testing may also include reverse engineering to
determine, for instance, boundary values or error messages.
Posted by Venkat.G (HOT opening for Freshers Refer www.venkat-jobs.blogspot.com) at 11:30 PM

You might also like