Thursday, December 29, 2011

Free QTP Framework


Above are the sixth components in my framework..






Now with the help of driver script you can complete your Test Automation..



'Adding sheets to Run-time data table
DataTable.AddSheet "Module"
DataTable.AddSheet "TestCase"
DataTable.AddSheet "TestStep"
DataTable.AddSheet "Login"

'Importing data from External File
DataTable.ImportSheet "C:\Documents and Settings\ShahadatK\Desktop\Proj_Automation\Orginizer\Organizer.xls",1,3
DataTable.ImportSheet "C:\Documents and Settings\ShahadatK\Desktop\Proj_Automation\Orginizer\Organizer.xls",2,4
DataTable.ImportSheet "C:\Documents and Settings\ShahadatK\Desktop\Proj_Automation\Orginizer\Organizer.xls",3,5
DataTable.ImportSheet "C:\Documents and Settings\ShahadatK\Desktop\Proj_Automation\TestData\data.xls",1,6

'Capturing Executable Modules from Module Sheet
MRowCount=DataTable.GetSheet("Module").GetRowCount
For i=1 to MRowCount Step 1
DataTable.SetCurrentRow(i)
ModuleExe=DataTable(3,"Module")
If UCase(ModuleExe)="Y" Then
ModuleId=DataTable(1,"Module")
'Msgbox "ModuleId: " & ModuleId

' Capturing executable test cases under executable modules
TCRowCount=DataTable.GetSheet("TestCase").GetRowCount
For j=1 to TCRowCount Step 1
DataTable.SetCurrentRow(j)
TCCaseExe=DataTable(3,"TestCase")
ModuleId2=DataTable(4,"TestCase")
If UCase(TCCaseExe)="Y" and ModuleId=ModuleId2 Then
TestCaseId=DataTable(1,"TestCase")
'Msgbox TestCaseId
'Capturing keywords for executable steps
TSRowCount=DataTable.GetSheet("TestStep").GetRowCount
For k=1 to TSRowCount Step 1
DataTable.SetCurrentRow(k)
TestCaseId2 = DataTable(5,"TestStep")
If TestCaseId=TestCaseId2 Then
keyword=DataTable(4,"TestStep")
'msgbox keyword


Select Case keyword
Case "ln"
Result=Login("abcd","mercury")
DataTable(7,"TestStep")=Result
Msgbox Result
Case "oo"
Result=Open_Order(5)
DataTable(7,"TestStep")=Result
Case "uo"
Result=Update_Order(5)
DataTable(7,"TestStep")=Result
Case "ca"
Close_App()

Case "lnd"
Rows=DataTable.GetSheet("Login").GetRowCount
For m=1 to Rows Step 1
DataTable.SetCurrentRow(m)
Result=Login2(DataTable(1,"Login"),DataTable(2,"Login"))
DataTable(3,"Login")=Result
Next
Case "ood"
Rows=DataTable.GetSheet("Login").GetRowCount
For n=1 to Rows Step 1
DataTable.SetCurrentRow(n)
Result=Open_Order2(DataTable(4,"Login"))
DataTable(5,"Login")=Result
Next

Case "uod"
Rows=DataTable.GetSheet("Login").GetRowCount
For p=1 to Rows Step 1
DataTable.SetCurrentRow(p)
Result=Update_Order2(DataTable(6,"Login"))
DataTable(7,"Login")=Result
Next
End Select
End If

Next
End If


Next

End If

Next

DataTable.ExportSheet "C:\Documents and Settings\ShahadatK\Desktop\Proj_Automation\TestResult\Result1.xls","TestStep"
DataTable.ExportSheet "C:\Documents and Settings\ShahadatK\Desktop\Proj_Automation\TestResult\Result1.xls","Login"

Wednesday, September 28, 2011

Crack version of QTP 11.0

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

https://h10078.www1.hp.com/cda/hpdc/navigation.do?action=downloadBinStart&caid=21691&cp=54_4000_100&zn=bto&filename=T6510FAE

Tuesday, September 13, 2011

Data Dictionary Object

Class clsTestData
Private mDict
Public sWorkBook
Public vSheet
Public iRow


Public Default Function Load(sWorkBook, vSheet, iRow)
With Me
.sWorkBook = sWorkBook
.vSheet = vSheet
.iRow = iRow
End With

BuildContext : Set Load = oDict
End Function


Private Function BuildContext
Dim oConn, oRS, arrData, x
CONST adOpenStatic = 3
CONST adLockOptimistic = 3
CONST adCmdText = "&H0001"

Set oConn = CreateObject("ADODB.Connection")
Set oRS = CreateObject("ADODB.RecordSet")


oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Data Source=" & Me.sWorkBook & ";" & _
"Extended Properties=""Excel 8.0;HDR=Yes;"";"


sQuery = "Select * From [" & Me.vSheet & "$]"


oRS.Open sQuery, oConn, 3, 3, 1


For x = 2 to iRow - 1 : oRS.MoveNext : Next

oDict = CreateObject("Scripting.Dictionary")


For x = 0 to oRS.Fields.Count - 1
With oDict
.Add "" & oRS(x).Name, "" & oRS.Fields(x)
End With
Next
End Function

Private Property Let oDict(ByVal Val)
Set mDict = Val
End Property
Private Property Get oDict()
Set oDict = mDict
End Property
End Class
Set mDataContext = New clsTestData


sWorkBook = "C:\Test.xls"
vSheet = "Sheet1"
iRow = 2

Set mDict = mDataContext.Load(sWorkBook, vSheet, iRow)

MsgBox mDict("Execute_Test")
MsgBox mDict("Scenario Name")
MsgBox mDict("Username")
MsgBox mDict("Password")



SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"


Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set mDict ("Username")
Dialog("Login").WinEdit("Password:").Set mDict ("Password")
Dialog("Login").WinButton("OK").Click

Tuesday, July 26, 2011

Count links in web page

Set objGmail =description.Create

objGmail("html tag").Value ="A"
'objGmail("Class Name").Value="Link"

Set objMail=Browser("Gmail: Email from Google").Page("Gmail: Email from Google").ChildObjects(objGmail)

objCB=objMail.count

msgbox objCB

Call User defined Function in QTP

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Public Function Login (Agent,Password)
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set (Agent)
Dialog("Login").WinEdit("Password:").Set (Password)
Dialog("Login").WinButton("OK").Click
End Function

Develope this function in Notepad and save with ext. .vbs. after that Setting->Resources-> Add this finction.

and call into the test..

Login "Skhan", "Mercury"

Thanks,
Shahadat Khan

Function in QTP

Login "Skhan","Mercury"

Public Function Login (Agent,Password)

Dialog("Login").WinEdit("Agent Name:").Set (Agent)
Dialog("Login").WinEdit("Password:").Set (Password)
Dialog("Login").WinButton("OK").Click
End Function

Thursday, July 21, 2011

How to swap two numbers without using third variable?

a = inputbox ("Enter the first value")
b = inputbox ("entre the second value")

msgbox "before swapping a="&a
msgbox "before swapping b="&b

a = int(a)+int(b)
b = int(a)-int(b)
a = int(a)-int(b)

msgbox "After swapping a="&a
msgbox "After swapping b="&b

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How to check wheather the string contains particular word or not in the string in qtp

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/
Var = "I am Shahadat Khan working with qtp"

If instr(1,Var,"Shahadat")then
msgbox "exist"
else msgbox "Not exists"
end If


Thanks,
Shahadat Khan

How to containts from Data table ?

Environment("Reportpath")="C:\Result.xls"
a=Browser("Google").Page("Google").WebTable
("index:=0").GetROProperty("outerhtml")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WriteFile = FSO.CreateTextFile( Environment
("Reportpath"), True)
writeFile.writeLine(a)
writeFile.close

Wednesday, July 20, 2011

How to Past an Image into the word documents?

Set objWord = CreateObject( "Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents. Add()
Set objSelection = objWord.Selection

Set objShape = objDoc.Shapes
objShape.AddPicture ("c:\images.jpg")

Wednesday, July 13, 2011

How to read contents from a file and write into the another file in QTP?

Dim, fso, file1, file 2, x

Set fso = Createobject("scripting.filesystemobject")
set file1 = fso.opentextfile("C:\Skhan\sk1.txt")
set file2 = fso.createtextfile("c:\skhan\sk2.txt")

Do Until fso.AtEndOfstream = True
x = file1.readline
file2 = writeline.x
Loop

File1.close
File2.close

Set fso.Nothing



Thanks,
Shahadat Khan

File System Objects(FSO) Model:

The File System Object (FSO) model provides an object-based tool for working with folders and files. It allows us to use the familiar object. method syntax with a rich set of properties, methods, and events to process folders and files. We can also employ the traditional Visual Basic statements and commands.


The FSO model gives our application the ability to create, alter, move, and delete folders, or to determine if and where particular folders exist. It also enables us to get information about folders, such as their names and the date they were created or last modified.


The FSO model makes processing files much easier as well. When processing files, our primary goal is to store data in an efficient, easy-to-access format. We need to be able to create files, insert and change the data, and output (read) the data. Although we can store data in a database, doing so adds a significant amount of overhead to our application. We may not want to have such overhead, or our data access requirements may not call for the extra functionality associated with a full-featured database. In this case, storing our data in a text file or binary file is the most efficient solution.


The FSO model, contained in the Scripting type library (Scrrun.dll), supports the creation and manipulation of text files through the TextStream object; however, the FSO model does not support binary files. To manipulate binary files, use the FileOpen Function with the Binary keyword.


FileSystemObject


Main object. Contains methods and properties that allow you to create, delete, gain information about, and generally manipulate drives, folders, and files. Many of the methods associated with this object duplicate those in other FSO objects; they are provided for convenience.


Drive Object


This Object Contains methods and properties that allow you to gather information about a drive attached to the system, such as its share name and how much room is available. Note that a "drive" isn't necessarily a hard disk, but can be a CD-ROM drive, a RAM disk, and so forth. A drive doesn't need to be physically attached to the system; it can be also be logically connected through a network.




Folder Object


This Object contains methods and properties that allow you to create, delete, or move folders. Also allows you to query the system for folder names, paths, and various other properties.


TextStream Object


This Object allows you to read and write text files.

Thursday, June 2, 2011

How many types object repository in QTP?

there are two types of object repository in qtp
1)LOCAL
2)SHARED

How can we generate script for exception handler in QTP?

We can generate the script for exceptions using recovery scenario manager or with in the script as well.

1.
using recovery script get the properties of the exception object and add it in the resources by naming the exception. We can create the recovery scenario in the options and add it in the resources of the file menu.when generating the script after the exception comes in type wait() please specify some number like 10 or any value in() so that it will wait and then add the recovery scenario over there ad continue with the script
2.
while writing the script with out using the recovery scenario use when event occurs goto step umber and add the recovery scenario by what ever the type of framework that you are using.

What is action split and the purpose of using this in QTP?

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

split action is mainly used for re-usability of the application.

spliting a action in to two parts saperatelly.

on calling an action go to call action properties and select call existing action.

Tuesday, May 24, 2011

How QTP recognizes the objects stored in object repository

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How QTP recognizes the objects stored in object repository
1. QTP uses the Object Repository to identify objects in the AUT. How will it identify objects stored in the OR? Well, the same way we identify each other because we have their "description" stored in our brain. Even though this is a bad example, but for the sake of explanation, let's say OR is the brain of QTP.

When QTP encounters an objects, it searches for that object in its brain and if it has encountered that object before, it performs the necessary action. If it does not, it fails the test; the same way, if you haven’t seen a person ever before and they ask for you to lend them $100, you would go like “Do I know you?” and walk away.

The OR should contain all the objects that you need for your tests to run successfully. If you want to write a keyword-driven script in QTP to login a user in www.gmail.com, you will have to access the Browser, the respective page, the username field, the password field and the SignIn button. All these objects will be then stored in QTP’s OR. So after you are done recording, you will playback the script and have the user login. This is done because QTP has already stored object definitions for all the objects it has to interact with in its OR.

There are ways to bypass this, by using Descriptive Programming and not making use of QTP’s OR. So, it entirely depends on what you want to use and what you are the most comfortable with.

What is test object?

What is test object?
Test Object is used by QTP to identify an object in the AUT during playback. While Run Time object that actually exists in the application

What is InStr Function?

InStr Function
Returns the position of the first occurrence of one string within another.
InStr([start, ]string1, string2[, compare])
start
Optional. Numeric expression that sets the starting position for each search. If omitted, search begins at the first character position. If start contains Null, an error occurs. The start argument is required if compare is specified.
string1
Required. String expression being searched.
string2
Required. String expression searched for.
compare
Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values. If omitted, a binary comparison is performed.
Dim SearchString, SearchChar, MyPos
SearchString ="XXpXXpXXPXXP" ' String to search in.
SearchChar = "P" ' Search for "P".
MyPos = Instr(4, SearchString, SearchChar, 1) ' A textual comparison starting at position 4. Returns 6.
MyPos = Instr(1, SearchString, SearchChar, 0) ' A binary comparison starting at position 1. Returns 9.
MyPos = Instr(SearchString, SearchChar) ' Comparison is binary by default (last argument is omitted). Returns 9.
MyPos = Instr(1, SearchString, "W") ' A binary comparison starting at position 1. Returns 0 ("W" is not found).

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How will you load the object during run time?

How will you load the object during run time?
1. Well, we won’t load objects during runtime, we only instruct QTP to interact with an object so it identifies it during runtime. QTP stores object definitions, or Test Object properties and along with those, it also stores Runtime object properties in its Object Repository. When the test runs, QTP maps these test object properties with the object’s runtime properties. If it successfully maps the runtime properties, test passes. If not, test fails.

If you were asking about creating an instance of a particular application (or process) via QTP, then yes, it can be done using the “CreateObject” function. CreateObject basically creates an instances of an OLE Automation.

For example, I want QTP to initiate an instance of Microsoft Excel, you would do it something like this:

Dim oExcel
Set oExcel=CreateObject(Excel.Application)
oExcel.Launch ‘(Just for reference) Start Excel
oExcel.visible=True ‘(Just for reference) Make Excel Application visible

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How do you close the Task Manager through QTP?

How do you close the Task Manager through QTP?

First you should add the Task Manager dialog box in the object repository.
This is not a modal dialog box so you can add it to repository easily.
Then use following simple code.

If Dialog("Windows Task Manager").Exist Then
Dialog("Windows Task Manager").Close
Reporter.ReportEvent micPass "Task Manager" "Successfully closed task
manager"
Else
Reporter.ReportEvent micFail "Task Manager" "Task Manager is not open"
End If

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

What is the difference between Normal mode and Fast mode?

What is the difference between Normal mode and Fast mode?
normal mode: runs your test or component with the execution arrow to the left of the keyword view or expert view, marking each step or statement as it is performed. If the test contains multiple actions, the tree in the keyword view item column expands to display the steps, and the expert view displays the script, of the currently running action. You must have microsoft script debugger installed to enable this mode. fast mode. Runs your test or component without the execution arrow to the left of the keyword view or expert view (for tests) and does not expand the item tree or display the script of each action as it runs. This option requires fewer system resources
What is the Obect Repository type
Object Repository: 2 types ( Per-action, Shared)
Per-Action: Default , but it is not reusable , used to that
current test only, Extension :- Mtr
Shared:its a reusable repository, we can use in multiple
scripts ,extension :- tsr
using this syntax : repositoriescollection.add("Path") we
can use int script itself

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

What is Description Object?

What is Description Object?
The description object enables descriptive programming which is basically accessing GUI objects without actually recording / storing them in an Object Repository. The description object will store a set of "properties" typically a "name and value pair" for a particular "class" which then can be accessed with the help of the description object.
e.g:
Set obj_desc = Description.Create
obj_desc("html_tag").value = "Password"
obj_desc("name").value = "txtUserPassword"
The name/value pair in this case is "html_tag" and "Password".It implies that the gui object will be an html tag with the tag name as Password.
Hence in the above case we manage to identify the gui object without actually referring to the object repository and then can use it inside the code to manipulate / perfrom operations on that object.

What is Test Frame Work?

What is Test Frame Work?
Automation framework is one....it is a test plan for
automation testing which drives entire automation testing
in a sytemamatic and scientific manner to execute the test
script like Main Script--->DriverScripts--->Environment
variables, Library files, Functions, Test Data(data table -
Parameterization.

Here MainTest Script will call the DriverScripts
DriverScripts will call the required Env, Lib files,
Func.....etc.

So the entire test will be executed/carried out in a flow
like explained above.(This comes under Keyword Driven
Framework).

QTP Certification Dump

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/
Question: 1
Where do you go to modify a shared object repository?
A. Resources > Object Repository Manager
B. Resources > Object Repository
C. Tools > Object Repository Manager
D. Tools > Resources Manager > Object Repository
Answer: A
Question: 2
What is a QuickTest Professional test comprised of?
A. calls to actions
B. calls to actions (reusable only)
C. calls to QuickTest Professional tests
D. calls and copies of actions
Answer: A
Question: 3
Where is the System Monitor tab located?
A. in the right pane of the Test Results window
B. in the Information pane
C. in the Resources pane
D. in the right pane of the System window
Answer: A
Question: 4
Which checkpoint type should you use to validate the enabled state of a button?
A. text
B. standard
C. bitmap
D. XML
Answer: B
Question: 5
Which language is used for Expert View?
A. TSL
91) An ........ assigns a numerical value to a test object that indicates its order or location relative to other objects with an otherwise identical description (objects that have the same values for all properties)
A) Index identifier.
B) ordinal identifier.
C) SMART ID identifier.
D) original identifier.
92) You can add an object to the local object repository only if that object does not already exist in a shared object repository that is associated with the action. If an object already exists in an associated shared object repository, you can add it to the local object repository using the ........ option.
A) Copy from Shared Repository
B) Copy from Shared Object Repository
C) Copy to Local
D) Copy to Local repository
93) You can copy, paste, and move objects in the local object repository using the Object Repository window, and copy, paste, and move objects both within a shared object repository and between shared object repositories using the Object Repository Manager. But you cannot copy objects from a shared object repository to the local object repository to modify them locally
A) True
B) False
94) At the time of copying, pasting and moving objects, you cannot move an object to any of its descendants.
A) True
B) False
95) When you remove a step from your test, its corresponding object is also removed from the object repository
A) True
B) False
96) You can use the Find and Replace dialog box to replace property or object names.

A) True
B) False
97) The Object Repository window is ...... during record and run sessions
A) read-only
B) read-write only
C) read-write and enable
D) None of above
98) In the Associated Repositories tab of the Action Properties dialog box, the ......object repository is always listed first and cannot be moved down the priority list or deleted.
A) local
B) shared
C) Both
D) None
99) In the Associated Repositories tab of the Action Properties dialog box, although we can order the object repositories according to our choice except the fact that Shared Repository remains the first one and cannot be removed.
A) True
B) False
100) If your object repositories are stored in the file system and you want other users or Mercury products to be able to run this action on other computers, you should set the file path as a
A) Absolute path
B) relative path
C) both
D) None of above

Answers

91) B, 92) C, 93) B, 94) A, 95) B, 96) B, 97) A, 98) A, 99) B, 100) B
71) QuickTest processes a comments when it runs a test.

A) True
B) False

72) Press ..... to add a new step below the currently selected step.

A) F8
B) Shift + A
C) F0
D) Shift + A + Q

73) While working with the Keyword View, you can ...... steps to move
them to a different location in a test or in an action

A) Copy and Paste
B) Cut and Paste
C) Drag and drop
D) Both A) and C)

74) You can specify the order in which the columns are displayed in the
Keyword view.

A) True
B) False

75) You can view ....... while working with keyword view.

A) object properties
B) action properties
C) action call properties
D) checkpoint properties
E) Output value properties
F) None of the above
G) All of above


76) You cannot manage some aspects of a local object repository using
the QuickTest Object Repository automation object model..

A) True
B) False

77) For each action, you can use a combination of objects from your
local and shared object repositories.

A) True
B) False

78) QuickTest adds all new objects to the local object repository even
if one or more shared object repositories are already associated with
the action assuming that an object with the same description does not
already exist in one of the associated shared object repositories..

A) True
B) False

79) If a child object is added to a local object repository, and its
parents are in a shared object repository, then you have to manually
drag and drop its parent objects from shared object repository to local
object repository.

A) True
B) False

80) The ....... is not accessible as a separate file

A) local object repository
B) shared object repository
C) Both
D) None

Answers

71) B, 72) A, 73) D, 74) A, 75) G, 76) B, 77) A, 78) A, 79) B, 80) A
81) In the Object Repository window:.
A) Local objects are editable (black)
B) Shared objects are in read-only format (gray)
C) Local objects are in read-only format (gray)
D) Shared objects are editable (black)
82) Mark true statement(s):.
A) You can delete objects from a shared object repository using the Object Repository window.
B) You can delete objects from the local object repository using the Object Repository Manager
C) You can delete objects from the local object repository using the Object Repository window
D) You can delete objects from a shared object repository using the Object Repository Manager
83) You can modify an object stored in a shared object repository.
A) using the Object Repository Manager
B) using the Object Repository window
C) you can copy it to the local object repository and then modify its properties
D) you cannot modify properties of objects stored in Shared object repository
84) If an object is contained in both local and shared repositories then, during a run session.
A) QuickTest will use the object in the local object repository
B) QuickTest will use the object in the Shared object repository
C) There will be a conflict
D) QuickTest will use Descriptive Programming
85) When you copy an object to the local object repository
A) its parent objects are also copied to the local object repository
B) its parent objects are not copied to the local object repository
C) You have to manually copy its parent objects are also copied to the local object repository
D) You have to manually drag and drop its parent objects
86) For tests, you can also view test object properties and property values for objects in the Active Screen, regardless of whether the objects are
stored in the object repository.
A) True
B) False
87) Object Properties window differs for objects stored in Shared and Local object repository.
A) True
B) False
88) You can rename objects in the shared object repository using the Object Repository Manager
A) True
B) False, you cannot rename objects in shared object repository
89) When you modify the name of an object in the local object repository, the name is automatically updated in ....... for all occurrences of the object..
A) in the Keyword View
B) in the Expert View
C) Both Keyword and Expert View
D) Changing name of an object doest not effect keyword or expert view
90) When you modify the name of an object in a shared repository, the name is automatically updated in all tests open on the same computer that use the object repository as soon as you make the change, even if you have not yet saved the object repository with your changes.
A) True
B) False

Answers

81) A,B, 82) C,D, 83) A,C, 84) A, 85) A, 86) A, 87) A, 88) A, 89) C, 90) A


61) You can use the Keyword View to add a step ..........in your test.

A) at the end
B) below the currently selected step
C) at the beginning
D) at anypoint

62) The Documentation cell is .............

A) Read-only
B) Write-only
C) Read and Write
D) Read, write & execute

63) An Item column can be any of the following:

A) A test object
B) A statement like Dim
C) A step generated by step generator
D) All of above

64) The Operation cell in the keyword view specifies the operation to be
performed on the item listed in the ........... column.

A) Operation
B) Documentation
C) Item
D) Value

65) Even if the Item column in the Keyword View is displayed to the
right of the Operation column, you must still first select an item to
view the list of available operations in the Operation column.

A) True
B) False

66) The Value cell in the keyword view can contain........ value

A) Constant
B) Parameter
C) Both A) & B)
D) None of these

67)The ............... enables you to encode your passwords and place
secure values into the Data Table.

A) Password Encoder
B) Password Decoder
C) Password Encode
D) Password Decode

68) You can also encrypt strings in Data Table cells using the .........
option in the Data Table menu.

A) Decrypt
B) Encrypt
C) Encrypt Code
D) Decrypt Code

69) In addition to adding standard statement steps to your test using
the Keyword View, you can also insert

A) Checkpoint step
B) Output value step
C) Comment step
D) All of above

70) The correct syntax of the conditiona statement starting with Do is.....

A) Do...While
B) Do...Until
C) Do...Next
D) Both A) and B)


Answers

61) D, 62) A, 63) D, 64) C, 65) A, 66) C, 67) A, 68) B, 69) D, 70) D
41) Object Spy can be found in ........menu.

A) Tool
B) Tools
C) Task
D) Tasks

42) ............ displays the open documents side-by-side.

A) Tile Vertically
B) Tile Horizontally
C) Cascade
D) Tile Cascade

43) For opening the QuickTest Professional Help we can use.......

A) F3
B) F5
C) F1
D) F2

44) If QTP cannot find any object that matches the description, or if it
finds more than one object that matches, QuickTest may use
the............mechanism to identify the object.

A) Ordinal Identifier
B) Index Identifier
C) Smart Identification
D) Assistive Identification

45) You can configure the ........, ............ and ............
properties that QuickTest uses to record descriptions of the objects in
your application

A) mandatory, assistive, and ordinal identifier
B) mandatory, required, and ordinal identifier
C) smart, assistive, and ordinal identifier
D) Index, assistive, and ordinal identifier

46) The .......... property set for each test object is created and
maintained by QuickTest.

A) Run-Time Object
B) Test Object
C) Smart Identification Object
D) Assistive Object

47)You can access and perform ......... methods using the Object property.

A) Run-Time Object
B) Test Object
C) Smart Identification Object
D) Assistive Object

48) You can view or modify the test object property values that are
stored with your test in the .........

A) Information Pane
B) Data Table
C) Information Pane & Data Table Both
D) Object Properties & Object Repository dialog box.

49) You can retrieve or modify property values of the test object during
the run session by adding ..........statements in the Keyword View or
Expert View.

A) GetROProperty & SetROProperty
B) GetTOProperty & SetTOProperty
C) GetTOProperty & SetROProperty
D) GetROProperty & SetTOProperty

50) If the available test object methods or properties for an object do
not provide the functionality you need, you can access ..............of
any run-time object using the Object property.

A) The internal methods and properties
B) The mandatory methods and properties
C) The selective methods and properties
D) The assistive methods and properties


Answers

41) B, 42) A, 43) C, 44) C, 45) A, 46) B, 47) A, 48) D, 49) B, 50) A
51) Using the Object Spy, you can view

A) the run-time or test object properties and methods of any object in
an open application.
B) the run-time or test object properties of any object in an open
application.
C) the test object properties and methods of any object in an open
application.
D) the run-time object properties and methods of any object in an open
application.

52) There are .........object type filters in Object spy dialog box.

A) Two
B)Three
C) Four
D) Five

53) In the Object Spy window, in the Properties Tab

A) Copying of Properties and its values is possible with CTRL+C
B) Copying of Properties and its values is possible by right clicking on
it and choosing copy.
C) Copying of Properties and its values is possible with both A) and B)
methods
D) Copying of Properties and its values is possible is not possible

54) In the Object Spy window, in the methods Tab

A) Copying of Methods is possible with CTRL+C
B) Copying of Methods is possible by right clicking on it and choosing copy.
C) Copying of Methods is possible with both A) and B) methods
D) Copying of Methods is possible is not possible

55) Object Spy dialog box

A) Can be resized
B) Cannot be resized

56) .............. are the highest level of the test hierarchy in the
Keyword view.

A) Tests
B) Steps
C) Call to Actions
D) Actions

57) You can copy and paste or drag and drop actions to move them to a
different location within a test

A) True
B) False

58) You can print the contents of the Keyword View to your Windows
default printer (and even preview the contents prior to printing).

A) True
B) False

59) In the Keyword View, you can also view properties for items such as
checkpoints.

A) True
B) False

60) In the step Browser > Page > Edit > Set "Sachin", identify container
object(s)

A) Browser
B) Edit
C) Page
D) Both Browser & Page

Answers

51) A, 52) A, 53) A, 54) A, 55) A, 56) D, 57) A, 58) A, 59) A, 60) D
31) You can manage the test actions and the test or function library
steps using the ... menu commands

A) File
B) Edit
C) Automation
D) Tools

32) To expand all the steps in the keyword view which option you would
use from the View menu.

A) Expand
B) Expand All
C) Expand Items
D) Expand Rows

33) What is the shortcut key to open a Step Generator.

A) F2
B) F5
C) F6
D) F7

34) Function Definition Generator in found in which menu option.

A) File
B) Tools
C) Insert
D) View

35) The shortcut keys for Record, Stop and Run respectively are

A) F3, F4, F5
B) F4, F3, F5
C) F4, F5, F3
D) F3, F5, F4

36) What is the shortcut key for opening an Object Repository.

A) Alt+R
B) Shift+R
C) Ctrl+R
D) Shift+O+R

37) Shortcut key to Insert/Remove a breakpoint is

A) F9
B) F8
C) Ctrl+b
D) Shift+b

38) .........runs only the current line of the script. If the current
line calls a method, the method is displayed in the view but is not
performed.

A) Step Over
B) Step Out
C) Step Into
D) Step Till

39) .........runs only the current line of the script. When the current
line calls a method, the method is performed in its entirety, but is not
displayed in the view.

A) Step Over
B) Step Out
C) Step Into
D) Step Till

40) What is the shortcut key to Clear all Breakpoints

A) Ctrl+Shift+F9
B) Shift+Ctrl+F9
C) Alt+Shift+F9
D) Alt+Ctrl+F9


Answers

31) B, 32) B, 33) D, 34) C, 35) A, 36) C, 37) A, 38) C, 39) A, 40) A
21) Panes in QTP can have one of the following states—docked or floating.

A) True
B) False

22) Which of the following statement is True:

A) QuickTest enables you to open and work on one test at a time
B) QuickTest enables you to open and work on two tests at a time
C) QuickTest enables you to open and work on predefined number of tests
at a time
D) QuickTest enables you to open and work on nine test at a time

23) Which of the following statement is True:

A) You can open and work on two function libraries simultaneously
B) You can open and work on multiple function libraries simultaneously
C) You can open and work on nine function libraries simultaneously
D) You can open and work on one function library at a time

24) You can open any function library, regardless of whether it is
associated with the currently open test.

A) True
B) False

25) You can work with multiple documents (test, component, or
application area, function libraries) using the...... dialog box

A) Panes
B) Display
C) Show
D) Windows

26) QuickTest has ..... built-in toolbars.

A) 5
B) 6
C) 7
D) 8

27) The ......... toolbar contains buttons for recording and running
your test.

A) Standard
B) Tools
C) Automation
D) Edit

28) Shortcut Key for opening a new Function Library is:

A) Shift+Alt+N
B) Ctrl+Alt+N
C) Shift+N
D) CRTL+N

29) Shortcut Key for Closing all open Function Libraries in one go.

A) Ctrl+Alt+C
B) Shift+A+C
B)Shift+N
D) None of these

30) shortcut Key for Commenting out the current row, or selected rows

A) Shift+M
B) Ctrl+C
C) Ctrl+M
D) Shift+C


Answers

21) A, 22) A, 23) B, 24) A, 25) D, 26) D, 27) C, 28) A, 29) D, 30) C
11) The Information pane provides a list of............. in the test:

A) Semantic errors
B) Syntax errors
C) Common errors
D) Logic errors

12) When we switch from Expert view to the Keyword view, QTP
automatically checks for syntax errors in the test and shows them in the
information pane.

A) True
B) False

13) If the information pane is not open, QTP automatically opens it in
case a syntax error is detected.

A) True
B) False

14) ..................... provides a list of the resources that are
specified in your test but cannot be found.

A) Missing pane
B) Missing Resources pane
C) Resources pane
D) Missing Items pane

15) Whenever you open a test or a function library, QTP automatically
checks for the availability of specified resources.

A) True
B) False

16) The Data Table does not assists you in parameterizing your test.

A) True
B) False

17) Tabs in the Debug Viewer pane are:

A) Watch, Variables, Debug
B) Watch, Data, Command
C) Watch, Variables, Command
D) View, Variables, Command

18) ............... tab enables you to view the current value of any
variable or VBScript expression.

A) Watch
B) VIew
C) Locate
D) Current

19) The .... tab displays the current value of all variables that have
been recognized up to the last step performed in the run session.

A) View
B)Variables
C) Locate
D) Current

20) The .........tab enables you to run a line of script to set or
modify the current value of a variable or VBScript object in your test
or function library.

A) View
B) Variables
C) Command
D) Current

Answers

11) B, 12) A, 13) A, 14) B, 15) A, 16) B, 17) C, 18) A, 19) B, 20) C
1) 'Browser navigation timeout' is in which tab of Test Settings
(File->Settings) window.

A) Properties
B) Resources
C) Web
D) Web Settings

2) How many tabs are there in Test Settings (File->Settings) window

A) 7
B) 6
C) 5
D) 8

3) Identify the tabs in the Test Settings (File->Settings) window

A) Properties, Run, Resources, Parameters, Environment, Web, Recovery
B) Properties, Run, Resources, Parameters, Environment, Web
Settings,Recovery
C) Properties, Run Options, Resources, Parameters, Environment, Web,
Recovery
D) Properties, Run, Resources, Input Parameters, Environment, Web, Recovery

4) 'Generate Script' is in which tab of Test Settings (File->Settings)
window

A) Properties
B) Web
C) Resources
D) Recovery

5) The following are the four main columns in the Keyword view

A) Item, Operation, Value, Comments
B) Item, Operation, Value, Documentation
C) Item, Operation, Property, Documentation
D) Number, Operation, Value, Documentation

6) For each object and method in an Expert View statement, a
corresponding row exists in the Keyword View.

A) True
B) False
C) There is a problem with the statement.
D) None of above

7) You can work on one or several function libraries at the same time.

A) True
B) False

8) You can insert additional steps on the test objects captured in the
Active screen after the recording session.

A) True
B) False

9) The Active Screen enables you to parameterize object values and
insert checkpoints

A) True
B) False

10) A QTP user can increase or decrease the active screen information
saved with the test.

A) True
B) False

Answers

1) C, 2) A, 3) A, 4) A, 5) b, 6) A, 7) A, 8) A, 9) A, 10) A
1) The new Object Repository Comparison Tool is
accessible from the Object Repository Manager. You can
use this tool to identify the differences between
objects in ........
A) two specified shared object repository files.
B) a Shared and a Local object repository files.
C) either Shared or Local object repository files.
D) two specified Local object repository files.

2) You can use the objects and methods of the
QuickTest .................... to write scripts that
automatically manipulate object repositories, instead of
performing these operations manually using the Object
Repository Manager.
A) Automation object model
B) Object Repository automation object model
C) Object Repository model
D) Object Repository Script Object model

3) You must convert object repository files from
QuickTest Professional 8.2.1 or earlier to the current
format before you can use them in QuickTest Professional
9.0 or later. Which method lets you do so.
A) Conversion method
B) Converge method
C) Convert method
D) None

4) You open the Object Repository window for a
specific component by choosing ..........
A) Resources > Object Repository
B) Tools > Object Repository
C) File > Object Repository
D) Help > Object Repository

5) In QTP 9 or above, Test objects can be stored in
two types of object repositories—........
A) a shared object repository and a Per-Action object
repository.
B) a shared object repository and a local object
repository.
C) a shared object repository and a Action object
repository.
D) Both A & C

6) The Object Repository Manager enables you to open
...... shared object repositories and modify them as
needed
A) multiple
B) three
C) two
D) Seven

7) ........ Method Loads the specified object
repository.
A) Overload
B) Load
C) Both A & B
D) None

8) An object repository that is currently open by
another user is locked, is it possible to merge a locked
object repository.
A) Yes
B) No

9) You can manage the shared object repository
associations of a selected test using the ............
A) Associate Repositories dialog box
B) Object Repositories dialog box
C) Associate Repositories Manager dialog box
D) Object Repositories Manager dialog box

10) All changes you make to an object repository are
automatically updated in all components open on the same
computer that use the object repository as soon as you
make the change—even if you have not yet saved the
object repository with your changes.
A) True
B) False

11) If you want to modify an object stored in a shared
object repository, you can modify it.......
A) using the Object Repository Manager
B) you can modify it locally using the Object Repository
window.
C) Both A & B
D) None of above

12) ................ Returns an ObjectRepositories
collection representing all object repository files
associated with the action.
A) Object Property
B) Automation Object Model
C) ObjectRepositories Property
D) OR PropertyAnswers

Answers:

1) a 2) b 3) c 4) a 5) b 6) a 7) b 8) a 9) a 10) a 11) c 12)c
1) You can import and export object repositories from
and to .... files.
A) XML
B) MTS
C) TSR
D) XLS

2) In general, the ....... object repository is
easiest to use when you are creating simple record and
run tests.
A) Shared
B) Local
C) Both
D) None

3) The Object Repository automation object model
enables you to manipulate QuickTest ....... object
repositories and their contents from outside of
QuickTest.
A) Shared
B) Local
C) Both
D) None

4) Before using the Object Repository automation
object model to manipulate shared object repository
stored in Quality Center, you must download the shared
object repository and save it to the file system.
A) True
B) False

5) SetTOProperty changes the property values used to
identify an object during the test run. It also effects
the values saved in the Object Repository for the
object.
A) True
B) False

6) After creating or editing an object repository XML
file, it is recommended to use the QuickTest
..........functionality to verify that your file
conforms to the QuickTest object repository schema.
A) Schema Verification
B) Schema Validation
C) XML Validation
D) XML Verification

7) To display the Comment in the Object Repository
dialog box, you must use the attribute name .........
A) miccommentproperty
B) commentproperty
C) mic_comment_property
D) None of above

8) ObjectRepositoryUtil Object Enables you to
manipulate .....object repository files from outside of
QuickTest Professional.
A) Shared
B) Local
C) Both
D) None

9) You can use the Object Repository Merge Tool to
merge objects from ......
A) two shared object repositories into a single shared
object repository.
B) the local object repository of one or more actions or
components into a shared object repository.
C) Both A & B
D) None

10) GetTOProperty method returns the value of a
specified property for a test object from the Object
Repository.
A) True
B) False

Answers:

1)a 2)b 3)a 4)a 5)b 6)b 7)a 8)c 9)c 10)a
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

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

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

4. What can you use to handle unpredictable testing exceptions?

A. A Do Loop
B. Recovery Scenario
C. IFHEN statement
D. Selectase statement

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

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

7. Where do you mark an action as reusable?

A. Action Settings
B. Action Properties
C. Action Run Settings
D. Action Call Properties

8. After running a test that contains both input and output parameters, where can the results of an
output parameter be found?

A. Local DataSheet
B. Global DataSheet
C. Run-time Data Table
D. Design-time Data Table


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

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

Answers:

1 2 3 4 5 6 7 8 9 10
C D B B B D B C C A
1) You cannot expand ...... actions from the test flow
view.
A) reusable
B) non-reusable
C) both A & B
D) None

2) You can associate shared object repositories with
...... actions simultaneously, using the Associate
Repositories dialog box
A) seven
B) Two
C) Three
D) Multiple

3) You can associate ....... object repositories with
an action, and the same object repository can be
associated with different actions as needed
A) Nine
B) Twenty one
C) as many as you need
D) Twelve

4) Sometimes you may want to call an action from
within an action. This is called .......
A) Reusability
B) Nesting
C) Sharing
D) None

5) If a reusable action is called more than once in a
test and you split the action into two independent
actions, each call to the action within the test will be
followed by a call to the new (reusable) action. If a
reusable action is called from another test, however,
...... it may cause the calling test to fail.
A) Nesting
B) Splitting
C) Reusing
D) Both A & C

6) You must use the ...... Action option in QuickTest
if you want to save an action under another name.
A) Resave
B) Rename
C) Reuse
D) Split

7) When you remove an external action, you remove all
calls and the action from the action list. The original
action is also affected.
A) True
B) False

8) You can also press ...... to open the Rename Action
dialog box
A) Shift + F2
B) Shift + F3
C) Shift + F4
D) Shift + F5

9) If you want to include one or more statements in
every new action in your test, you can create an ....
A) reusable action
B) split action
C) Function
D) action template

11) Only the file name ...... is recognized as an
action template
A) ActionTemplate.mst
B) Action_Template.mst
C) Action-Template.mst
D) ActionTemplates.mst

Answers:

1) a 2) d 3) c 4) b 5) b 6) b 7) b 8) a 9) d 11) a

Compare 2 Excel sheets cell by cell

This code will open two excel sheet and compare each sheet cell by cell, if any changes there in cells , it will highlight the cells in red color in the first sheet.
Set objExcel = CreateObject(“Excel.Application”)
objExcel.Visible = True
Set objWorkbook1= objExcel.Workbooks.Open(“C:Documents andSettingsmohan.kakarlaDesktopDocs1.xls”)
Set objWorkbook2= objExcel.Workbooks.Open(“C:Documents and
Settingsmohan.kakarlaDesktopDocs2.xls”)
Set objWorksheet1= objWorkbook1.Worksheets(1)
Set objWorksheet2= objWorkbook2.Worksheets(1)
For Each cell In objWorksheet1.UsedRange
If cell.Value <> objWorksheet2.Range(cell.Address).Value Then
cell.Interior.ColorIndex = 3′Highlights in red color if any changes in cells
Else
cell.Interior.ColorIndex = 0
End If
Next
set objExcel=nothing

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How to capture Text form the webpage?

How to capture Text form the webpage?

you can use GetROProperty method to retrive runtime values inside an
object.
IF your application is web based..
runtimeValue=B("X").P("X").WebEdit("x").GetROProptery("name of the
property which value you want to retrive").. for that use GUI spy

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

QTP Interviews Questions

• Import and Export of files.
• Random testing of 500 test cases.
• Invoking of application
• Opening notepad in QTP &Writing of Test Result in Notepad.
• Merging of Two Repositories
• Data file / Verification of data file when file is not available
in local system.
• Business process component / Types and usage.
• Opening of notepad in QTP to write and execute the coding.
• How to find local host name using QTP
• How to handle exception when data table is not available in local
host system or Path is not correct (Explain Statement with example)
• Runtime dynamic settings.
• Script generated after applying database check point.
• Script generated at the time of setting runtime property.
• Types of exception handling and script for that.
• Scripting

Friday, May 20, 2011

Reasons why we should (or shouldn’t) automate a test?

Below are some factors to consider to help identify which manual tests should or should not be automated. Just because you can automate something doesn’t necessarily mean that you should. Here are some guidelines to help identify good candidates for test automation:

Tests that should be automated:

Tests that need to be run against every build/release of the application, such as smoke test, sanity test and regression test.
Tests that utilize the same workflow but different data for its inputs for each test run (data-driven and boundary tests).
Tests that need to gather multiple information during run time, like SQL queries and low-level application attributes.
Tests that can be used for performance testing, like stress and load tests
Tests that take a long time to perform and may need to be run during breaks or overnight. Automating these tests maximizes the use of time.
Tests that involve inputting large volumes of data.
Tests that need to run against multiple configurations — different OS & Browser combinations, for example.
Tests during which images must be captured to prove that the application behaved as expected.

Important: Remember that the more repetitive the test run, the better it is for automation

Tests that should not be automated:

User experience tests for usability (tests that require a user to respond as to how easy the app is to use).
Tests that you will only run one-time. (This is a general rule. I have automated one–time tests for data population situations in which the steps can be automated quickly, and when placing in a loop can produce thousands of records, saving a manual tester considerable time and effort)
Test that need to run ASAP.
Tests that require ad hoc/random testing based on domain knowledge/expertise.
Tests without predictable results. For automation validation to be successful, it needs to have predictable results in order to produce pass and fail conditions.
If a test needs to be manually “eyeballed” to determine whether the results are correct.
Test that cannot be 100% automated should not be automated at all — unless doing so will save a considerable amount of time.
What would you add or remove from this list? Let me know.

QTP 11 patch – Fixes .NET, BPT, Service Test and other issue

If we are using QuickTest Pro 11 I highly recommend that you install patch QTP_00709. The patch fixes the following issues:



1. If the QTP_00699 - Support Testing on 64-Bit Applications (For Specified Technologies) patch was not installed on 64-bit operating systems, all .NET 4.0 controls on 32-bit applications were recognized as SwfObjects.

2. Recovery scenarios did not work in BPT wrapper tests.

3. Run-time errors were displayed if you ran a business component that contained a QCUtil.CurrentTest.Name step.

4. Function libraries that were created from an application area, opened in read-only mode.

5. In Quality Center 10.00, the Parameters of Test dialog box opened when you added QuickTest 11.00 tests to the execution grid.

6. If a QuickTest test called a Service Test test (and both tests were stored in Quality Center), the run results for the Service Test test were not uploaded to Quality Center at the end of the run session.

7. If you renamed a QuickTest action after inserting a call from it to a Service Test test, an error occurred during the run session.

8. QuickTest crashed or an OS blue screen appeared when using a User-Defined / Non-HLLAPI emulator on Windows 7 with Office 2007/2010 installed.

9. You could not view the baseline history for scripted components that were stored in version control-enabled Quality Center projects.

10. In QuickTest, if you tried to delete an application area that was associated with one or more components, QuickTest mistakenly opened a message box asking you to confirm the deletion of the application area instead of informing you that the application area is in use and providing you with further instructions. This occurred only if the application area was moved to a different location in the Quality Center/ALM Test Resources module after a component was associated with it.

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Why is QTP 11 results viewer is taken more time?

If you’ve upgraded to QTP 11 recently and are finding that the Results Viewer is taken a long time to display test results, then you should install HP’s hotfix RRV_00013. This patch will fix the following issues:

1. Reduces the amount of time it takes to open large run results.
2. Reduces the amount of time it takes to export large run results.
3. Displays the data table in results for business process tests created using Quality Center 10.00.
4. Provides support for multiple icon file types (in addition to *.ico) including *.png, *.jpg, and *.gif.
5. Fixes various issues that prevented the run results tree from being displayed correctly.
6. Fixes an issue that sometimes caused the Run Results Viewer to crash.

To get the hotfix RRV_00013, contact HP, or you can download it from here


for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Why is QTP working very slowly in my machine?

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

There are times when the local user and temporary directory files have a problem and they need resetting to resolve the issues

Below process will reset all setting for the current user of QuickTest Professional. This will not remove QuickTest Professional from a machine. The batch file will back up the QuickTest Professional registry setting for the local user in a directory created in the procedure below. Note some of the custom setting for user preference will be lost during running of this command file.

Download the file from http://www.ftporasi.com/HP%20Utilities/ClearQTPUser.cmd File location confirmed.

1.Download file.
2.Ensure user has local admin rights before running batch file.
3.Create a directory to place this file in like C:\QTPClearUser
4.Stop QuickTest Professional if running.
5.Open Dos Prompt and go to directory created above.
6.Run the file batch file.
7.Recommend rebooting
8.Start QuickTest Professional to see if issue has been resolved.

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Saturday, May 14, 2011

What is Reporter Objects in QTP?

Reporter Object is used for sending information to the test results. With the help of this object you can:
>Report the status of test results (like pass, fail, warning)
>Enable/Disable reporting of step(s) following the statement.
>Retrieve the folder path in which the current test's results are stored.
>Retrieve the run status at the current point of the run session.
There are some very important methods and properties associated with it.
ReporterEvent Method:

I think this is a very common method used with Reporter object. I am sure even if you have worked on QTP for a relatively short period, you would have come across this.
Its syntax:
Reporter.ReportEvent EventStatus, ReportStepName, Details
where EventStatus can be:
0 or micPass: If this step runs test passes which is shown in test report.

1 or micFail: If this step runs test fails which is shown in test report.

2 or micDone: Used to send message to the test report and does not affect status of test.

3 or micWarning: Again, used to send warning message to the test report and does not affect status of test.
and
ReportStepName is name of step
and
Details are the user defined details for the given step.
For Example:
Reporter.ReportEvent micPass, "Login Authorization", "The user-defined step passed."
Filter property

I have mentioned this on my other post Some Useful Tips with QTP but would like to mention it again here since I get a lot of questions on this.
There can be situations where you don't want the full status displayed on the test report. This property can be used to selectively filter the status of your tests.
Its syntax:
Reporter.Filter = NewMode
where NewMode can be:

0 or rfEnableAll: This is the default mode. All reported events are displayed in the Test Results.

1 or rfEnableErrorsAndWarnings: Only those events with a warning or fail status are displayed in the Test Results.

2 or rfEnableErrorsOnly: Only those events with a fail status are displayed in the Test Results.

3 or rfDisableAll: All events in the Test Results are disabled.
ReportPath Property

This is used to get the path in which current test results are stored.
Its syntax:

Path_of_Results = Reporter.ReportPath
RunStatus Property

This is used to get the current status of the run session
Its syntax:
Reporter.RunStatus
For Example:
if Reporter.RunStatus = 0 then flag=1;

QTP Certification Dumps

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/
Q1. 'Browser navigation timeout' is in which tab of Test Settings (File->Settings) window.
A) PropertiesB) ResourcesC) WebD) Web Settings

Q2. How many tabs are there in Test Settings (File->Settings) window
A) 7B) 6C) 5D) 8

Q3. Identify the tabs in the Test Settings (File->Settings) window
A) Properties, Run, Resources, Parameters, Environment, Web, Recovery
B) Properties, Run, Resources, Parameters, Environment, WebSettings,Recovery
C) Properties, Run Options, Resources, Parameters, Environment, Web,Recovery
D) Properties, Run, Resources, Input Parameters, Environment, Web, Recovery

Q4. 'Generate Script' is in which tab of Test Settings (File->Settings)window
A) PropertiesB) WebC) ResourcesD) Recovery

Q5. The following are the four main columns in the Keyword view
A) Item, Operation, Value, CommentsB) Item, Operation, Value, DocumentationC) Item, Operation, Property, DocumentationD) Number, Operation, Value, Documentation

Q6. For each object and method in an Expert View statement, acorresponding row exists in the Keyword View.A) TrueB) FalseC) There is a problem with the statement.D) None of above

Q7. You can work on one or several function libraries at the same time.A) TrueB) False

Q8. You can insert additional steps on the test objects captured in the Active screen after the recording session. A) TrueB) False

Q9. The Active Screen enables you to parameterize object values andinsert checkpointsA) TrueB) False

Q10. A QTP user can increase or decrease the active screen informationsaved with the test.A) TrueB) False

Q11. The Information pane provides a list of............. in the test:A) Semantic errorsB) Syntax errorsC) Common errorsD) Logic errors

Q12. When we switch from Expert view to the Keyword view, QTPautomatically checks for syntax errors in the test and shows them in theinformation pane.A) TrueB) False

Q13. If the information pane is not open, QTP automatically opens it incase a syntax error is detected.A) TrueB) False

Q14. ..................... provides a list of the resources that arespecified in your test but cannot be found.A) Missing paneB) Missing Resources paneC) Resources paneD) Missing Items pane

Q15. Whenever you open a test or a function library, QTP automaticallychecks for the availability of specified resources.A) TrueB) False

Q16. The Data Table does not assists you in parameterizing your test.A) TrueB) False

Q17. Tabs in the Debug Viewer pane are:A) Watch, Variables, DebugB) Watch, Data, CommandC) Watch, Variables, CommandD) View, Variables, Command
Q18. ............... tab enables you to view the current value of anyvariable or VBScript expression.
A) Watch
B) VIew
C) Locate
D) Current

Q19. The .... tab displays the current value of all variables that havebeen recognized up to the last step performed in the run session.
A) View
B)Variables
C) Locate
D) Current

Q20. The .........tab enables you to run a line of script to set ormodify the current value of a variable or VBScript object in your testor function library.
A) View
B) Variables
C) Command
D) Current

Q21. Panes in QTP can have one of the following states—docked or floating.
A) True
B) False

Q22. Which of the following statement is True:
A) QuickTest enables you to open and work on one test at a time
B) QuickTest enables you to open and work on two tests at a time
C) QuickTest enables you to open and work on predefined number of testsat a time
D) QuickTest enables you to open and work on nine test at a time

Q23. Which of the following statement is True:
A) You can open and work on two function libraries simultaneously
B) You can open and work on multiple function libraries simultaneously
C) You can open and work on nine function libraries simultaneously
D) You can open and work on one function library at a time

Q24. You can open any function library, regardless of whether it isassociated with the currently open test.
A) True
B) False

Q25. You can work with multiple documents (test, component, orapplication area, function libraries) using the...... dialog box
A) Panes
B) Display
C) Show
D) Windows

Wednesday, April 20, 2011

How to connect to Database in QTP?

I recieved a mail by user(Swati) regarding database connectivity. thank you very much for suggestion...

Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3

Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")

objConnection.Open "DRIVER={Microsoft ODBC for Oracle};UID=;PWD="

objRecordset.CursorLocation = adUseClient
objRecordset.CursorType = adopenstatic
objRecordset.LockType = adlockoptimistic

ObjRecordset.Source = "select field1,field2 from testTable"
ObjRecordset.ActiveConnection = ObjConnection
ObjRecordset.Open 'This will execute your Query

If ObjRecordset.recordcount>0 Then
Field1 = ObjRecordset("Field1").Value
Field2 = ObjRecordset("Field2").Value
End If

Tuesday, April 19, 2011

Online Services

Online Training (QTP, QTP Framework).
Online prepration of QTP Certifications.
Online Training (VB Scripting)
Sell QTP Framework.
QTP Dumps for certification.
Setup of Testing Environment for Automation Testing.
Providing candidates for Automation Testing.
Project work for Automation Testing Testing.
Project Work on contract Basis.

Please mail me for any type of services
shahadat.it786@gmail.com

Thursday, April 7, 2011

How Script to write in the file and read using loop?

"Also to get the version detail of vbscript."

Dim filesys, text, readfile, contents


set filesys = CreateObject("Scripting.FileSystemObject")
Set text = filesys.CreateTextFile("c:\test.txt")


text.Write "Find the last character in the text file"
text.Write " '
text.Write "Find the last character in the text fil"
text.Close


Set readfile = filesys.OpenTextFile("c:\somefile2.txt", 1, false)
Do while readfile.AtEndOfLine <> true 'Condition to get end letter of first line'


'Do while readfile.AtEndOfStream <> true 'Condition to get end letter of file'
contents = readfile.Read(1)
'WScript.Echo contents 'Print all the letter for file'
Loop
readfile.close


'Response.Write "The last character in the text file is '" & contents & "."
WScript.Echo "The last character in the text file is '" & contents & "."
WScript.Echo ScriptEngine
WScript.Echo ScriptEngineBuildVersion
WScript.Echo ScriptEngineMajorVersion
WScript.Echo ScriptEngineMinorVersion
WScript.Echo Second(Time)
WScript.Echo Tan(55.0)

Script to create a instant of existing file and list out the complete information of the same

Dim filesys, demofile, createdate


Set filesys = CreateObject("Scripting.FileSystemObject")
Set demofile = filesys.GetFile("e:\TEST.xls")


createdate = demofile.DateCreated
WScript.Echo (createdate)


strHomeFolder = "E:\QTP"


Set objShell = CreateObject("Wscript.Shell")
Set filesys = CreateObject("Scripting.FileSystemObject")


If filesys.FolderExists (strHomeFolder) Then
' Assign user permission to home folder.
intRunError = objShell.Run("%COMSPEC% /c Echo Y
cacls " & strHomeFolder & " /t /c /g Administrators:F ", 2, True)
WScript.Echo (intRunError)


If intRunError <> 0 Then
Wscript.Echo "Error assigning permissions for user " & strUser & " to home folder " & strHomeFolder
Else
Wscript.Echo "In inner loop"
End If
End if






WScript.Echo (demofile.Attributes)
WScript.Echo (demofile.Type)
WScript.Echo "Date created: " & demofile.DateCreated
Wscript.Echo "Date last accessed: " & demofile.DateLastAccessed
Wscript.Echo "Date last modified: " & demofile.DateLastModified
Wscript.Echo "Drive: " & demofile.Drive
Wscript.Echo "Name: " & demofile.Name
Wscript.Echo "Parent folder: " & demofile.ParentFolder
Wscript.Echo "Path: " & demofile.Path
Wscript.Echo "Short name: " & demofile.ShortName
Wscript.Echo "Short path: " & demofile.ShortPath
Wscript.Echo "Size: " & demofile.Size
Wscript.Echo "Type: " & demofile.Type


WScript.Quit

How Script to search specific word from the file?

#!/usr/local/bin/perlprint ("Word to search for $ARGV[0]\n");$filecount = 1;$totalwordcount = 0;

while ($filecount <= @ARGV-1) {unless (open (INFILE, $ARGV[$filecount])){die ("Can't open input file $ARGV[$filecount]\n"); } $wordcount = 0; while ($line = ) { chop ($line); print ("Before split : $line\n"); @words = split(/ /, $line); print ("Content is : @words\n"); $w = 1; while ($w <= @words) { if ($words[$w-1] eq $ARGV[0]) { $wordcount += 1; } $w++; } } }

print ("total number of occurrences $totalwordcount\n");

How Script to write in a file?

#!/usr/local/bin/perl
open (MYPIPE, "cat >hello");
print MYPIPE ("Hi, Dave! Your QTP program sent this!\n");


close (MYPIPE);

How Script to read a file using while loop?

#!/usr/local/ActivePerl-5.8/bin/perl
if (open(MYFILE, "file1")) {
$line = ;
while ($line ne "") {
print ($line);
$line = ;
}
}

Friday, February 25, 2011

How to find current time, Hour, Minute, second in QTP

H=Hour(now)
msgbox H

H=Hour(Time)
msgbox H

M=Minute(now)
msgbox M

S=Second(now)
msgbox S

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How to find current time in QTP

systime= Time
msgbox systime

How to find current time and date in QTP

mynow=now
msgbox mynow

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How to convert date formate in QTP

Mydate=date
msgbox "Current Formate"&Mydate

myday =day(date)
'msgbox myday

mymonth = month(date)
'msgbox mymonth

myyear = Year(Date)
'msgbox myyear

msgbox "New Formate "&myday&"/"&mymonth&"/"&myyear

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How to print a table in QTP

Set obj=createobject("Scripting.filesystemobject")
Set of=obj.createtextfile("c:\Shahadat.txt")
For i=1 to 10
x=2*i
of.writeline"2 * "&i&" = "&x
Next

How to Reverse String in QTP

'Plese reverse the string.....Shahadat Khan

str="Shahadat Khan"
Dim l
l=Len(str)
For i=l to 1 step -1
strresult=mid (str,i,1) 'Returns a specified number of characters from a string.Ex.
'Dim MyVar
'MyVar = Mid("VB Script is fun!", 4, 6) ' MyVar contains "Script".
finalresult=finalresult&strresult

Next

msgbox finalresult

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Tuesday, February 22, 2011

Immediate requiremen​t for QA Engineer proffs

Dear,

Greetings from Adecco.....

We have a opening with our prestigious client in Hyderabad for QA Engineer Proffs :::

Client : PORTWARE

Location : Hyderabad

Required Skills ::

- Minimum 3 - 5 years working in QA .
- - Writing Java Programs to simplify testing would be an added advantage.

If you are interested for Hyderabad Location and who can join within 30 - 45 Days, Please revert back with your updated profile at hepzybha.g@adecco.co.in

with These details:

Total Exp (Yrs) :
Exp in Testing Enterprise Systems (Yrs) :
Exp in Manual Testing (Yrs) :
Exp in Manual and Automated test Development (Y/N) :
Exp in writing Java Programs (Yrs) :
Current Employer :
Highest Qualification :
Current CTC :
Expected CTC :
Notice Period :
Current Location :
Willing to Relocate to Hyderabad (Y/) :
Reason looking out for job change :

How to do Batch run in qtp?

Click on TOOL->Options->Run, select Other HP Product to run
Tests and components

after that click on Start menu->Quick Test Professional-
>Tool->Test Batch Runner; Test batch runner will be open,
click Batch on menu bar and select the Tests which you want
to run in couples.
Please let me know if any question/suggestion
Thanks,
Shahadat Khan

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Urgent opening with NIIT TECHNOLOGIES

There is an urgent and hot opening with NIIT TECHNOLOGIES (www.niit-tech.com).
Below are the details :-
Experience: 3.5 to 6 yrs
Position based at Noida / Gurgaon.
Interview Location – Noida. (Thursday 17 December)
Required Skills:

QTP 9.2 experience is a must, VB Script, Framework
Good Knowledge of STLC
Good understanding of Test Methodologies
Working Knowledge of QTP frameworks and scripting experience is a must.
Candidate must have good understanding of QA processes
Should have worked in the test architecture design

So if are interested, please send your updated CV at sanjay@brainsoftconsultants.com with the following information:

Current CTC
Expected CTC
Notice period

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Sapient hiring Automation Test Professionals

Sapient is looking for Senior Associate QA test professionals with rich experience in Quick Test Professional (QTP). Experience in Automation Framework Designing, Test Estimation, Test Strategy formation, Test Reporting.
Candidates should have a between 4 to 6 years of experience in testing IT applications.
Desirable: Exposure to at least one automation project in the last one year.
Job Location: Gurgaon
If you are interested, please send your updated CV at mdhar3@sapient.com with the following information
Current CTC:
Expected CTC:
Notice Period:
Reason for change:
Other required skills are

Testing Strategy & Management Test Strategy
Define test strategies for low to medium …

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

TCS is looking for QTP professionals

TCS is looking for QTP professionals.
Below are the details:
Skill: QTP Testing
Experience: 4 to 6 Yrs
Joining Location: Bangalore
Mode: Contract to Hire
If you are interested, please send your updated CV at jayadevi.hr@gmail.com with the following information:
CURRENT CTC:
EXPECTED CTC:
NOTICE PERIOD:
TECHNICAL REFERENCES:

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

QTP tester

Need QTP tester CMML5 Co.In Mumbai,
Experience required 3-5 Years.

Please call Ulka

ulka@harjaicomputers.com

QTP Interview Questions and Answers

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/
33. Checking Bitmaps:
A.) You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. QuickTest captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk space.

When you run the test or component, QuickTest compares the object or selected area of the object currently displayed on the Web page or application with the bitmap stored when the test or component was recorded. If there are differences, QuickTest captures a bitmap of the actual object and displays it with the expected bitmap in the details portion of the Test Results window. By comparing the two bitmaps (expected and actual), you can identify the nature of the discrepancy.

For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly.

You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins is loaded).

Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.

34. Text/Text Area Checkpoint: In the Text/Text Area Checkpoint Properties dialog box, you can specify the text to be checked as well as which text is displayed before and after the checked text. These configuration options are particularly helpful when the text string you want to check appears several times or when it could change in a predictable way during run sessions.

Note: In Windows-based environments, if there is more than one line of text selected, the Checkpoint Summary pane displays [complex value] instead of the selected text string. You can then click Configure to view and manipulate the actual selected text for the checkpoint.

QTP automatically displays the Checked Text in red and the text before and after the Checked Text in blue. For text area checkpoints, only the text string captured from the defined area is displayed (Text Before and Text After are not displayed).

To designate parts of the captured string as Checked Text and other parts as Text Before and Text After, click the Configure button. The Configure Text Selection dialog box opens.

35. Checking XML: XML (Extensible Markup Language) is a meta-markup language for text documents that is endorsed as a standard by the W3C. XML makes the complex data structures portable between different computer environments/operating systems and programming languages, facilitating the sharing of data.

XML files contain text with simple tags that describe the data within an XML document. These tags describe the data content, but not the presentation of the data. Applications that display an XML document or file use either Cascading Style Sheets (CSS) or XSL Formatting Objects (XSL-FO) to present the data.

You can verify the data content of XML files by inserting XML checkpoints. A few common uses of XML checkpoints are described below:

- An XML file can be a static data file that is accessed in order to retrieve commonly used data for which a quick response time is needed—for example, country names, zip codes, or area codes. Although this data can change over time, it is normally quite static. You can use an XML file checkpoint to validate that the data has not changed from one application release to another.

- An XML file can consist of elements with attributes and values (character data). There is a parent and child relationship between the elements, and elements can have attributes associated with them. If any part of this structure (including data) changes, your application's ability to process the XML file may be affected. Using an XML checkpoint, you can check the content of an element to make sure that its tags, attributes, and values have not changed.

- XML files are often an intermediary that retrieves dynamically changing data from one system. The data is then accessed by another system using Document Type Definitions (DTD), enabling the accessing system to read and display the information in the file. You can use an XML checkpoint and parameterize the captured data values in order to check an XML document or file whose data changes in a predictable way.

- XML documents and files often need a well-defined structure in order to be portable across platforms and development systems. One way to accomplish this is by developing an XML schema, which describes the structure of the XML elements and data types. You can use schema validation to check that each item of content in an XML file adheres to the schema description of the element in which the content is to be placed.

36. Object Repositories types, which & when to use?
A.) To choose the default object repository mode and the appropriate object repository mode for each test, you need to understand the differences between the two modes. In general, the object repository per-action mode is easiest to use when you are creating simple record and run tests, especially under the following conditions:

- You have only one, or very few, tests that correspond to a given application, interface, or set of objects.

- You do not expect to frequently modify test object properties.

- You generally create single-action tests.

Conversely, the shared object repository mode is generally the preferred mode when:

- You have several tests that test elements of the same application, interface, or set of objects.

- You expect the object properties in your application to change from time to time and/or you regularly need to update or modify test object properties.

- You often work with multi-action tests and regularly use the Insert Copy of Action and Insert Call to Action options.

37. Can we Script any test case with out having Object repository? or Using Object Repository is a must?
Ans: No. U can script with out Object repository by knowing the Window Handlers, spying and recognizing the objects logical names and properties available.

38. How to execute a WinRunner Script in QTP?
Ans :

(a) TSLTest.RunTest TestPath, TestSet [, Parameters ] --> Used in QTP 6.0 used for backward compatibility

Parameters: The test set within Quality Center , in which test runs are stored. Note that this argument is relevant only when working with a test in a Quality Center project. When the test is not saved in Quality Center , this parameter is ignored.
e.g : TSLTest.RunTest "D:\test1", ""

(b) TSLTest.RunTestEx TestPath, RunMinimized, CloseApp [, Parameters ]
TSLTest.RunTestEx "C:\WinRunner\Tests\basic_flight", TRUE, FALSE, "MyValue"
CloseApp : Indicates whether to close the WinRunner application when the WinRunner test run ends.
Parameters : Up to 15 WinRunner function argument

39. How to handle Run-time errors?
Ans: On Error Resume Next : causes execution to continue with the statement immediately following the statement that caused the run-time error, or with the statement immediately following the most recent call out of the procedure containing the On Error Resume Next statement. This allows execution to continue despite a run-time error. You can then build the error-handling routine inline within the procedure. Using "Err" object msgbox "Error no: " & " " & Err.Number & " " & Err.description & " " & Err.Source & Err.HelpContext

40. How to change the run-time value of a property for an object?
Ans : SetTOProperty changes the property values used to identify an object during the test run. Only properties that are included in the test object description can be set.

41. How to retrieve the property of an object?
Ans : using "GetRoProperty".

42. How to open any application during Scripting?
Ans : SystemUtil, object used to open and close applications and processes during a run session. A SystemUtil.Run statement is automatically added to your test when you run an application from the Start menu or the Run dialog box while recording a test
E.g : SystemUtil.Run "Notepad.exe"
SystemUtil.CloseDescendentProcesses (Closes all the processes opened by QTP)

43. Types of properties that Quick Test learns while recording?

Ans : (a) Mandatory (b) Assistive .

In addition to recording the mandatory and assistive properties specified in the Object Identification dialog box, QuickTest can also record a backup ordinal identifier for each test object. The ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description (objects that have the same values for all properties specified in the mandatory and assistive property lists). This ordered value enables QuickTest to create a unique description when the mandatory and assistive properties are not sufficient to do so.

44. What is the extension of script and object repository files?
Ans : Object Repository : .tsr , Script : .mts, Excel : Default.xls

45. How to supress warnings from the "Test results page"?
Ans : From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked".

46. When we try to use test run option "Run from Step", the browser is not launching automatically why?

Ans : This is default behaviour.

47. How to "Turn Off" QTP results after running a Script?
Ans : Goto "Tools > Options > Run Tab" and Deselect "View results when run session ends". But this supresses only the result window, but a og will be created and can viewed manulaly which cannot be restricted from getting created.

48. How to verify the Cursor focus of a certain field?
Ans : Use "focus" property of "GetRoProperty" method"

49. How to make arguments optional in a function?
Ans : this is not possible as default VBS doesn't support this. Instead you can pass a blank scring and have a default value if arguments r not required.

50. How to covert a String to an integer?
Ans : CInt()---> a conversion function available.

51. Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why?
Ans : Inserting a call to action will only Import the columns of the Action called