Posted on November 23rd, 2015 by Prabhat Nayak
While automating an application, sometimes we have a number of homogeneous objects having one or more properties with same value present in a page and we have to perform a specific operation on all the objects in that page. Adding all the objects to the object repository means increase in script size and it gets […]
Posted on November 23rd, 2015 by Prabhat Nayak
At times we have to right click on an object (Links, Table Contents etc.) to bring up its context menu from which we can select any one option. It seems very straight when we do the task manually, but simulating the mouse click through scripting is not as simple. The following example demonstrates how to […]
Posted on November 23rd, 2015 by Vivek Mishra
At times we need to check spelling of multiple objects, such as Link, Button, Weblist etc present on a single page. In QTP,if we use the Record/Playback funtionality or the Shared Object Repository method, it would become difficult as we have to add all the onjects first and then do the spell check individually. To overcome this we can […]
Posted on November 23rd, 2015 by Susangeet Kanungo
How to convert the chekpoint into the type of inline code validation agianst expected result in QTP ?. ‘” Get a reference to the object we want to validate “ Set ObjLink=Browser(“”).page(“”).Link(“Link “) ‘”Read the actual property values we want to validate from that object “ actualHREF=ObjLink.GetROProperty(“href”) actualTEXT=ObjLink.GetROProperty(“text”) ‘”Define the values we expect these properties […]
Posted on November 23rd, 2015 by Jyoti Acharya
It is possible to Control what types of steps are written to the test results using the following statements. Reporter.Filter=<Filter value> The <Filter value> must use one of the following QTP built-in variables. 1-rfEnableAll- Report all steps.This is the default setting 2-rfEnableErrorsAndWarnings- Only report error(failed)and warning steps. 3-rfEnableerrorsOnly- Only report error steps. 4-rfDisableAll- Does […]
Posted on November 23rd, 2015 by Jyoti Acharya
A library is nothing but a file which contains function procedures and sub procedures. These library files can be associated to any script in QTP,so that the script in QTP can call or reuse the procedures present in the library file. Library files can have 3 extensions as below: >.txt >.vbs >.qfl Creating Library […]
Posted on November 23rd, 2015 by Prabhat Nayak
There are times when we open QTP and try to spy on browser objects or record on them and QTP does not recognize any of them. They are recognized as Windows objects. There can be many reasons for this behavior of QTP. Below are few steps by following any one of them or a combination […]
Posted on November 23rd, 2015 by Jyoti Kar
QTP through Vb script engine provides the RegExp class which is used for general regular expression evaluation and processing. ‘Function to check if a string matches a regular expression pattern’. Function RegEqual(r_Text,r_Pattern,MatchCompleteString) Dim regEx,retVal ‘Create regular expression object’. Set regEx=New RegExp ‘Set pattern’ regEx.Pattern=r_Pattern ‘Ignore case’ regEx.IgnoreCase=True ‘Match complete String or Not’ regEx.Global=MatchCompleteString ‘Test the […]
Posted on November 23rd, 2015 by Prabhat Nayak
This TIP demonstrates establishing connection between QTP and Oracle and fetching few records from the database. ‘Declare a connection variable Dim strConnection ‘Assign connection details to connection variable strConnection= “Driver= {Microsoft ODBC for Oracle}; ” &_ “ConnectString=(DESCRIPTION=” &_ “(ADDRESS=(PROTOCOL=Protocol Type)” &_ “(HOST=host name) (PORT=port number))” &_ “(CONNECT_DATA=(SERVICE_NAME=service name)));” &_ uid=userid; pwd=password;” ‘Create Connection and […]
Posted on November 23rd, 2015 by Vivek Mishra
Some times the application we are automating is very slow, and QTP may run very fast. Now how can we Synchronize the application with QTP .There are three best ways available in QTP . 1. Using Synchronization point :- This is one of the best method, using this we can synchronize against a properity-value […]
Posted on November 23rd, 2015 by Jyoti Acharya
‘Create the html path ‘store it in a test results folder sFile=Reporter.ReportPath & “StepsToRecreate.html” ‘Create the HTMl file Set FSO=CreateObject(“Scripting.FileSystemObject”) Set file1=FSO.CreateTextFile(sFile,True) file1.Write “<p><B>Step 1</B> Launch www.gmail.com” file1.Write “<p><B>Step 2</B> Enter Username xyz” file1.Write “<p><B>Step 3</B> Enter password as pqr ” file1.Write “<p><B>Step 4</B> Click on Login button” file1.Write “<p><B>Step 5</B> Check Mail” file1.Write […]
Posted on November 23rd, 2015 by Susangeet Kanungo
How to exexute a script for all Global datatable iterations, when the script is set to run for only one iteration in QTP ”To Declare the variable” Dim i,icount ”To Get the Globalsheet object” Set Global=Datatable.GlobalSheet ”To take the values in rows” icount=Global.GetRowCount For i=1to icount ”To Set value in the current row” Global.SetCurrentRow i […]
Posted on November 23rd, 2015 by Jyoti Acharya
Utility Objects —————– QTP Provides the several utility objects to enhance the power of scripting.Utility Objects are the reserved objects in qtp.These objects can be used in reporting preferences during run time. There are various Types of Utility Objects: 1)Crypt Object 2)DataTable Object 3)Description Object 4)DotNetFactory Object 5)DTParameter Object 6)DTSheet Object 7)Environment Object 8)Extern Object […]
Posted on November 23rd, 2015 by Jyoti Acharya
Bitmap Checkpoint: ————————- This checkpoint checks the content of the bitmap in the application.Bitmap checkpoints can be placed for any area of the application.Bitmap checkpoint are also applicable for buttons,text boxes and tables. Steps to insert a Bitmap Checkpoint: —————————————– 1)In recording mode select Insert>Checkpoint>Bitmap Checkpoint. 2)Click an object to be checked and select the […]