Monday, June 8, 2015

Browser Compatability

- 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

 

 

 

QTP/UFT vs IE Support Matrix


QTP/UFT vs Firefox Support Matrix

VersionsQTP v9.2QTP v9.5QTP v10QTP v11UFT v11.5UFT v12UFT v12.01UFT 12.02
Mozilla v32, v33, v34NANANANANANANAYES
Mozilla v29, v30, v31NONONONOYES with support of UFT_00044 + UFT_00068 + UFTWEB_00001 NOYESYES (YES for v31 ESR)
Mozilla v28NONONONOYES with support of UFT_00044 + UFT_00068 NOYESYES
Mozilla v27NONONONOYES with support of UFT_00044 + UFT_00066 YESYESYES
Mozilla v25, v26NONONONOYES with support of UFT_00044 + UFT_00066 NONONO
Mozilla v24NONONONOYES with support of UFT_00044 NO (YES for v24 ESR)NO (YES for v24 ESR)NO (YES for v24 ESR)
Mozilla v22, v23NONONONOYES with support of UFT_00022 + UFT_00056 NONONO
Mozilla v20, v21NONONOYES 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 UFT_00022 NONONO
Mozilla v19NONONOYES 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.]YES with support of UFT_00001 + UFT_00037 NONONO
Mozilla v17, v18NONONOYES with support of QTPWEB_00090 + QTPWEB_00122 YES with support of UFT_00001 NO (YES for v17 ESR)NO (YES for v17 ESR)NO (YES for v17 ESR)
Mozilla v15, v16NONONOYES with support of QTPWEB_00090 + QTPWEB_00112 YESNONONO
Mozilla v13, v14NONONOYES with support of QTPWEB_00090 + QTPWEB_00105 YESNONONO
Mozilla v12NONONOYES with support of QTPWEB_00090 + QTPWEB_00100 YESNONONO
Mozilla v9, v10, v11NONONOYES with support of QTPWEB_00090 + QTPWEB_00092 YESNO (YES for v10 ESR)NO (YES for v10 ESR)NO (YES for v10 ESR)
Mozilla v4, v5, v6, v7, v8NONONOYES with support of QTPWEB_00090 YESNONONO
Mozilla v3.6NONOYES with support of QTPWEB_00059 YES with support of QTPWEB_00063 YESNONONO
Mozilla v3.0, v3.5NONOYES with support of QTPWEB_00046 YESNONONANA
Mozilla v3.0 Alpha 7NOYESNONONONONANA
Mozilla v2.0YESYESNONONONONANA
Mozilla v1.5YESYESNONONONONANA

QTP/UFT vs Chrome Support Matrix


Support for Chrome Incognito mode

[Incognito mode is a stealth mode where Chrome won’t track your activities you perform on the web]
To work with this mode, you need to allow some settings in Google Chrome browser.
  1. In Chrome, go to Tools > Extensions and check the developer mode.
  2. Make sure that the UFT agent at the bottom is enabled.
  3. Check “Allow in Incognito mode”.
  4. Make sure you have a single window of Chrome open during record/replay.


Tuesday, June 2, 2015

Objects and Methods related to QTP- DB connection



Working with DataBase in QTP - Understanding Connection and Recordset object
QTP Interacts with database creating an instance of ADODB object using ADO. ADO is a Microsoft technology and stands for ActiveX Data Objects and is a programming interface to interact and access data from a database.

                                  Connection Object

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.

Strconnection = "Driver=… "Server=svrnme;uid=username;pwd=password;"
For e.g to connect to a database for excel the strConnection would be like:
strcon = "Driver={Microsoft Excel Driver (*.xls)};Dbqls="+xfilename +";ReadOnly=0;"

For details of connection strings, see www.connectionstrings.com

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 property returns True if the current record position is before the first record in the Recordset,

EOF property returns 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

Wednesday, May 20, 2015

Object Identification and tips



- Make use of regular expression


How to handle properties which are dynamic ?
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
RepositoryParameter1
Image 9
RepositoryParameter2
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.
Image 10
RepositoryParameter5
-

Source:

http://www.learnqtp.com/uft-object-identification-tips/

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.
qtp-object-identification-tips

Load relevant Add-ins

Make sure you have loaded ALL the relevant add-ins required for your Application Under Test (AUT).

Record and Run Settings

While working on web based applications, make sure Record and run test on any open browser is selected under Record > Record and run settings.

BHO Manager

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.)
zoom
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.

Version of Browser and Windows OS

Make sure the version of QTP you use supports the version of your browser and/or your Windows operating system. Check the complete UFT vs browser support matrix and UFT vs Windows support matrix.

Pop-up Window not identified?

Check this article

Install relevant patch

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:

http://www.learnqtp.com/uft-object-identification-tips/
http://www.learnqtp.com/category/object-identification-in-qtp/
http://www.learnqtp.com/understanding-enigmatic-to-and-ro-property/
http://www.learnqtp.com/qtp-unable-to-identify-pop-up-window/



 

- Webex Trainining notes:



What are Ordinal Identifiers ?

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.

'Will have CreationTime value = 0
SystemUtil.Run "iexplore.exe", "http://www.google.com"    
'Will have CreationTime value = 1 
SystemUtil.Run "iexplore.exe", "http://www.yahoo.com"     
'Will have CreationTime value = 2  
SystemUtil.Run "iexplore.exe", "http://www.microsoft.com" 
'Will have CreationTime value = 3 
SystemUtil.Run "iexplore.exe", "http://www.facebook.com"  

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.