- http://www.learnqtp.com/patches/
Here you can download patches for each browser.
- QuickTest supports recording tests only on Microsoft Internet Explorer. It supports running tests on the following Web browsers:
➤ Microsoft Internet Explorer
➤ Netscape Browser
➤ Mozilla Firefox
➤ Applications with embedded Microsoft Internet Explorer Web browser controls
YES
with support of QTPWEB_00129. [This is a Hotfix, who can download/get
these hotfixes is determined by HP Support, either via email, FTP, etc.,
please submit a support case requesting such, and preferably indicate
purpose of such request.]
YES
with support of QTPWEB_00127. [This is a Hotfix, who can download/get
these hotfixes is determined by HP Support, either via email, FTP, etc.,
please submit a support case requesting such, and preferably indicate
purpose of such request.]
QTP Interacts with database creating an instance of ADODB object using ADO. ADO is a Microsoft technology and stands forActiveXDataObjects and is a programming interface to interact and access data from a database.
Before a database can be accessed by QTP, An object for database connection has to be established.
Set adocon = createobject(“Adodb.connection”)
Once the object is created, we need to set connection string to connect to the database. We can define a connection string with details of database including database provider, database, and user credentials for access.
Some useful methods and properties of connection object are as follows:
Properties:
adocon.connectionstring – This property sets or returns the details used to create a connection to a data source. Includes details of driver, database,username and password.
adocon.ConnectionTimeout– this defines the time to wait for a connection to be established.
adocon.provider– This sets or gets connection provider name.
adocon.state– gives status whether connection is on or off.
Methods
adocon.open– opens a database connection based on the connection string provided.adocon.Open connectionstring,userID,password,options
adocon.Execute– execute the sql statement provided
adocon.execute“Select * from table”
adocon.close– This closes the adodb connection.
RecordSet Object:
Once a connection has been established, we can create recordset object to hold a set of record from database. A recorset consists of records and column
Set rs = createobject(“”Adodb.recordset”)
Some useful methods and properties of RecordSet Objects are as follows:
Properties:
BOF propertyreturns True if the current record position is before the first record in the Recordset,
EOF propertyreturns True if the current record position is after the last record in the Recordset, otherwise it returns False. For a empty recordset,i.e no records in the recordset or empty recordset, value of BOF and EOF is false. So the property can be used in a loop to validate RecordSet does not return any records.
MaxCountProperty returns the maximum value of records to be returned in a recordset.
rs.MaxCount = 20 will return 20 rows of data in recordset.
Methods:
rs.cancel–cancels an existing execution.
rs.clone–returns a clone of existing recorset and assigns to an object
set rsclone = rs.clone
rs.Close - closes instance of recordset
rs.open– opens a recordset based on query specified.
rs.open sqlquery, adocon
where sqlquery is query executed and adocon is connection object.
rs.move– moves the pointer in a recordset by specified count as defined in numrec
rs.move numrec, start.
Also movenext,moveprevious, movefirst, movelast can be used to move to specified location in recordset.
rs.fields.countgives number of items in the fields collection.
rs.field.item(i) returns specified item from the collection
There is an option to replace the property value with a Repository parameter. In this way you can handle the dynamic values for the properties.
In order to do so you need to select the property you want to parameterize and then Select “”(<#>) button on the right side. You get the window “Repository Parameter”
Image 8
Image 9
The value can be a constant that is the same value as before. If you want you can add regular expressions to it.
Regular expression : It is a way to define the search criteria for the string. You can use special characters such “.”, “*”, “[]” etc to define the same.
For example : If you select “Regular Expression” checkbox and add “.*” to your string. So it will search for an object that has “alt” property starting with text “Google” and can have any number of characters after that.
Second way is to select the parameter from the datatable/Environment/Random Number. You can select the radio button “Parameter” and make appropriate settings.
17 Things To Try When UFT Does Not Identify an Object:
QTP First
I have repeated this many times in the past and it is still remains the #1 object identification tip. While testing on any app, make sure QTP is opened first and then your application. QTP works by hooking into your application. If you open QTP after your application has started there are chances that QTP may not be able to identify objects.
Load relevant Add-ins
Make sure you have loaded ALL the relevant add-ins required for your Application Under Test (AUT).
Make sure BHO Manager in IE under Tools > Manage Add-Ons > Enable or Disable Addons is enabled.
Enable Extensions
If you are working on Firefox or Google chrome browser, don’t forget to enable browser extensions.
In case of Firefox go to Firefox menu > Add-ons > Extensions and enable Unified Functional Testing Extension .
For Chrome go to Tools > Extensions and enable Unified Functional Testing Agent.
QuickTest supports recording tests only on Microsoft Internet Explorer. It supports running tests on the following Web browsers:
➤ Microsoft Internet Explorer
➤ Netscape Browser
➤ Mozilla Firefox
➤ Applications with embedded Microsoft Internet Explorer Web browser controls
Disable Protected Mode
In IE, clear the Enable Protected Mode option under Tools > Internet Options > Security
User Account Control(UAC)
UAC was introduced in Windows Vista and continued in Win 7 and Win 8/8.1. UAC can interfere with your application. It is a good idea to disable it while working on QTP.
To turn-off UAC in Windows 7, go to Start Menu > Search for “Change User Account Settings” > Disable UAC
To turn-off UAC in Windows 8/8.1, you need to take help of registry. UI setting doesn’t truly turns-off UAC in Win 8/8.1. Hit Win + R key, type regedit and click OK. Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\SystemFind the key: EbableLUA and change the Value Data value to 0
Zoom Level
Make sure the zoom level is set to 100% while testing in any browser. Check the illustration below on how zoom-level affects highlight object functionality in QTP. (Focus on the blinking black rectangle on the left once the Highlight button is clicked on the right.)
A shortcut key to get back to 100% zoom is Ctrl + 0 (that’s zero).
.Object Notation
There are times when identification properties are not enough to identify an object. You may make use of native properties in that case. Use .object notation to locate the erring property. Make sure to correctly identify it.
Low level recording
After you have exhausted all options you can try Low level recording. It’s not a good method from maintenance point of view but it may come handy at times.
My QTP has worked for ages identifying objects correctly, stopped working since yesterday
If something like that has happened probably there is some change in your browser or UFT software itself. Try to disable auto-updates on machines where QTP is installed.
Type property for WebButton class
If you’re testing cross browser, don’t use Type property to identify Webbutton class since the default value is different for IE (button) and Firefox (Submit).
Object with dynamic properties
If QTP was successfully able to identify object at record time but unable to identify the same object during replay time, there are chances that object properties are dynamic in nature. Make use of regular expression or parameterization to handle those dynamic values.
In case your application version is not supported by the version of QTP, keep an eye on various patches that HP comes up with from time to time. Check the complete support matrix of QTP/UFT with various technologies. We strive to keep this up-to-date.
Few websites that are usefull for object identification are:
Sometimes
there are series of objects with same class name and properties. Lets us say in
a window there are series of checkboxes with the same set of properties. If we
want to act on those objects we need to uniquely identify them so that QTP will
be able to act on it.
An
Ordinal Identifier assigns a numerical value to the test objects which
indicates its location or order relative to its group. The Ordered value enables
QTP to recognize it uniquely when the inbuilt properties are NOT sufficient to
do so.
There
are 3 Ordinal Identifiers in QTP that can be used in different context:
Index
Location
Creation Time
Index:
An
object appearing first in the page/Window will have a smaller Index value when
compared to another object that comes later in the same page/Window.
The
Value of index for the group of text boxes will be as follows:
Object
Name
Index
Value
TextBox
1
0
TextBox
4
1
TextBox
2
2
TextBox
5
3
TextBox
3
4
TextBox
6
5
Location:
The
Location property works vertically from top to bottom and from left to right.
Hence for the same case, the value of location for the group of text boxes will
be as follows:
Object
Name
Index
Value
TextBox
1
0
TextBox
2
1
TextBox
3
2
TextBox
4
3
TextBox
5
4
TextBox
6
5
Creation Time:
The
Creation Time property holds good only for web based application. When we open
2 browser sessions of the same website, QTP will not be able to recognize the
window as both the window will have the same set of properties. Hence we can
use creation time with which QTP will be able to act on the window.
Hence
to work on a specific browser, we need to explicitly mention the Creation time
in OR or we can use description of objects which we will see in detail in
descriptive programming section.
'Sync's www.google.com
Browser("creationtime:=").Sync
'Gets the
RO text property of www.yahoo.com
Browser("creationtime:=1").GetROProperty("text")
'Highlights microsoft.com
Browser("creationtime:=2").Highlight
-
5/12/15:
Make sure your objects and respective properties are listed in the object repository before your script.
Even when you record your script, the objects will be stored in Object Repository.
So it is must to have the objects(of web application) stored in object repository, before you run your script on web application.
What are the different ways of identifying objects in a web page?
11/6/2015
- One last option if the QTP/UFT does not recognize object is try using Virtual Object.
Virtual object -- there is seperate post in the same blog.
12/24/2015:
- DOM concept could also be used to identify objects in QTP. Refer DOM blog for the same.
Looks like object identification is based on the source code, so could be more easy for us as developers and testers refer to same source code. And we know to read source code.