RSS Feed

QTP Tutorial – QTP Smart Object Identification, Sync Point, and Test Result Analysis

Posted on

Smart Identification:

Assume a situation when no object matches or multiple objects match the recorded description for an object during run time, how does QTP handle it?

QTP has a mechanism in place for cases exactly like this. If the recorded description does not enable QTP to identify the specified object in a step, and a smart identification definition is defined (and enabled) for the object, QTP tries to identify the object using “Smart identification”.

Let us see how this works with some examples.  For every object there are Primary Properties and Secondary properties.

Example 1: Object with the recorded description is not found.

On a page there was a button and the following are properties:
a) Primary: Name
b) Secondary: Abs x,y

While recording the “Name” property was “Login ID”. Due to some changes to the application, the “Name” property is now changed to “User ID”. In this case, QTP will find a button with a different description and it should fail if it considers the primary properties alone.

But in cases like this when the primary properties don’t match then it checks the secondary ones and if they match it recognizes the object. In this case, it is going to recognize the button by its X and Y co-ordinates.

Example 2: QTP was supposed to find a page X and there are 2 pages with similar browser settings.

In this case too, it tries to use the “name” or other properties to find the right page/pages and works accordingly.

The above 2 are examples of cases where QTP engages the smart identification mechanism.

  • The Test results will also show if a step employed Smart identification to run successfully.
  •  If QTP cannot find the object despite Smart Identification, then the test fails.

For most of the objects, QTP provides a default Base filter properties (Primary) and Optional filter properties (Secondary) that it checks if we enable Smart identification for them. The user does have an option to edit what properties to consider too. To do so, go to “Tools->Object Identification”. Choose the relevant Environment from the drop down and choose the Object Class. Once you chose it, check the “Enable Smart Identification” and click “Configure”.

Smart identification

Click Add or Remove

Smart identification

Select the properties as required:

Smart identification

Make your selection and Click OK when done.

Smart identification

The above process will ensure that the next time it has difficulty identifying an object of this class, it will employ smart identification to do so.

Also, for most of the objects “Smart identification” is turned ON by default. You can see where this is the case for a certain object by accessing it in the OR under “Additional details” part of its object properties.

It is set to “True” if enabled and “False” if disabled.

You could also choose to enable or disable Smart identification entirely for a test run. Choose “File->Settings->Run->Disable Smart Identification during the run session” option.

Synchronization point:

Consider this program,

1 SystemUtil.Run "iexplore.exe", ""
2 Browser("Gmail: Email from Google").page("Gmail: Email from Google").Sync
3 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "swatiseela"
4 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Passwd").SetSecure "sfgs686898"
5 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebButton("Sign in").Click
6 Browser("Gmail: Email from Google").Page("Gmail - Inbox").Link("Sign out").Click

In an ideal world, as soon as you hit the “Sign in” button in the gmail login page, the “Inbox” should get displayed without any delays. That means, the state of the application is ready for the last statement in our example to be executed immediately after the last but one statement runs.

But in real time, due to many reasons applications don’t always load at the same pace. If we do not instruct QTP to wait a certain while before it moves on. More specifically until an object attains a certain state.

A synchronization point is used to instruct QTP to wait until a particular object property achieves the value you specify.

On inserting a sync point a “Wait Property” statement is inserted into the test.

1 Browser("Gmail: Email from Google").Page("Gmail - Inbox"). Link("Sign out").WaitProperty “Visibile”,true,20

So your new program is going to look something like this: (line #6 below)

1 SystemUtil.Run "iexplore.exe", ""
2 Browser("Gmail: Email from Google").page("Gmail: Email from Google").Sync
3 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "swatiseela"
4 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Passwd").SetSecure "sfgs686898"
5 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebButton("Sign in").Click
6 Browser("Gmail: Email from Google").Page("Gmail - Inbox"). Link("Sign out").WaitProperty “Visible”,true,1000
7 Browser("Gmail: Email from Google").Page("Gmail - Inbox").Link("Sign out").Click

It can be inserted while recording using the menu option “Insert->Synchronization Point”.  Choose the Object to insert the sync point.

Synchronization point

Enter the value as required:

Synchronization point

This is the statement that gets inserted:

1 Browser("Gmail - Inbox").Page("Gmail - Inbox").Link("Sign out").WaitProperty "visible", true, 10000

Running a test

1) Automation->Run or F5 typically runs the entire test.

2) You can run a part of the test by choosing “Automation->Run Current Action” option

3) You can run a test from a certain point in your test by choosing “Automation->Run From Step” option.

4) As soon as you choose any of the above ways to run a test, you will be promoted to choose the location where you would like the test results to be stored. You can choose the folder by choosing the first option in which case, the results will be stored for every instance of the test run. But if you choose the next option, temporary folder, the results get overwritten and only the latest test run result will be stored in the folder chosen. In terms of memory, it is advisable to use the second option while testing your QTP test. Unless you want every test run results, do not choose the first option because obviously it is going to use up a lot of space.


Running a test

5) Input parameters:  If the test input parameters were defined for this test, this tab is the place where you provide them.

Running a test

6) You can also run a couple of tests all at once in a batch. QTP has a “Batch Runner” tool. It is also an external tool just like a “Password encoder tool” that we discussed earlier.

7) To launch go to “Programs > QuickTest Professional > Tools > Test Batch Runner”. Create a batch (.mtb) using icon1.

Running a test

8) Once creating a list is done, run the batch using icon2 icon. After the batch run is complete, you can view the results for each test in its default test results folder (<test folder>\res#\report).

Test results:

In our articles so far, whether we are discussing data table iteration, checkpoints, smart identification or in general the test step run , the Test results is the place you get to see whether something was successful or not.

Apart from the above, the test results can hold the screenshot of your AUT when a failure occurs. This depends on the settings at “File->Settings->Run”.

The tester can print and export test results.

To make test results more understandable the user can write his comments into the test results.

For example, if a certain condition fails in your test you might want to write in the test results that “Did not work for the value X”. You can do so by using the “reporter.reportevent” statement. The following is the syntax:

Reporter.Reportevent(Event Status,Reporter step name, details)

Event status: MicPass, MicFail,MicWarning,MicDetail, the next two parameters can be any text that helps include further detail.

If this is my statement and I run it:

reporter.ReportEvent micPass,”Swati’s First Step”,”Passed coz I told it to pass …”

The test results are going to look like this: (click to enlarge image)

Test results


Since this is not a very widely used feature, I am going to do a high level introduction here.

Typically, a test is divided into transactions when you have to measure how long it takes to run a certain section of it.

It is also used when a QTP test is to be used by Load Runner or Business Process Monitor. In either of these cases, your test has to be recorded in terms of a transaction and anything outside of it will be ignored.

You can start a transaction from QTP using “Insert->Start Transaction”. Give it a name, choose if you want it before or after the current step and choose OK.


Services.StartTransaction “TransactionTest” – Gets inserted. Now I will record a login into

Once you are done recording. Choose “Insert->End Transaction”. Click OK.


Services.EndTransaction “TransactionTest” – gets inserted.

This is the code:


Now I will run this test. Let us see how the test results look. The results will show a summary in terms of time taken to finish the transaction.


Silent Test runner:

Another tool that QTP provides is the Silent Test runner. This enables the tester to run his test without having to launch QTP. It also helps simulate QTP runs from load runner and verify it compatibility with the same.

It will not work if QTP is already open and another test is running via it.

Use Start > Programs > QuickTest Professional > Tools > Silent Test Runner menu command to invoke it. Select the test and click “Run Test”

Silent Test runner

This is how it looks while running the test:

Silent Test runner

Once it is completed:

Silent Test runner

Test Run log:

Silent Test runner

The “Transaction Summary” will be activated if the test contains at least one transaction.

QTP Tutorial – How to Make QTP Tests Modular and Reusable Using Actions and Function Libraries

Posted on

QTP Actions and Action Properties:

Actions divide a test into logical units. This aids in highly readable tests and make sure that modularity is achieved.

There are 3 types of QTP actions:

  1. Reusable – only these can be called multiple times within the same or different tests
  2. Non-reusable – These cannot be called by any other actions
  3. External actions – a reusable action when called from another action becomes an external action in the called action.

How to use QTP Actions in  tests?

1) By default all new actions are reusable

2) Every action has its own “Action” datasheet or a local sheet

3) Call to an existing action in another test can be inserted by using the menu option: “Insert->Call to an existing action-> (Choose test/action)”

QTP Actions

4) The statement or action call inserted in the current test will be as follows:

1 RunAction “Action2[Testname]”, oneiteration

5) The action will be called as many times as the action called properties is specified for the parent action.

Action2 is a reusuable action in Test2. It is called on every iteration in the datatable of Test2.
Action1 is the action that calls Action2 in Test1.
Action1 runs only once.
Then, Action2 will run only once irrespective on how many times it was called in Test2.

6) A previously reusable action can be changed to become non-usable and vise versa.

7) When a previously reusable action is marked as non-reusable the test that calls the action fails and a warning message is displayed to the user.

8) We have seen in the previous article how parameters can be passed “To” and “From” actions.
To define these you could do one of the following:
a) Choose the action from the keyword view, right click and choose action properties.
b) While in the action in the expert view, select Edit->Action Properties from the menu.

9) The dialog box appears with General (name, description, reusable or not), Parameters(i/p or o/p), associated repositories (can associate another action’s OR) and Usedby tabs

QTP Actions

10) To send parameters to an action the general syntax is:

1 RunAction “Action Name”. Oneiteration, i/p parameters, o/p parameters

The following are some of the ways in which you can utilize the output value of an action in your test depending on your requirement:

a) Action o/p value (value returned by a called action) can be stored in a variable.

1 RunAction “Action1”,OneIteration, i/pvalues, x, x being the variable

b) Action o/p value can be stored in an environment variable.
To create an environment variable choose “File->Settings->Environment tab” , in the ‘Variable Type’ drop down choose userdefined and click + and ‘Add new environment Parameter’ – enter the name (env_Var) and an empty value and click OK.

QTP Actions

To assign the o/p value to this variable,

1 RunAction “Action1”,OneIteration, i/pvalues, Environment(“env_var”)

c) Action o/p value can be stored in a data table column.

1 RunAction “Action1”, OneIteration, i/pvalue, DataTable(“A”, dtGlobalsheet)

QTP Functions and Function Libraries:

Though there are many built in functions available in the QTP for the tester, there might still be instances when you might want to perform a specific operation and make those steps reusable. You could do that by creating user defined functions, put them in a separate file, associate it with the test and have the function name work as a keyword for that particular test.


So by definition, a function is nothing but a piece of code that performs a certain task.

Let’s create a function library now:
Use the menu option “File->New->Function Library” or “Shift+Alt+N” or click on the “New” drop down option in the menu and choose “Function library”

QTP will open up an editor, very similar to the keyword view of a test. Here you can write your code. I am going to include statements that will login a user into page.

QTP Functions

1 Function gmailLogin(uname, pwd)
2 SystemUtil.Run "iexplore.exe", ""
3 Browser("Gmail: Email from Google").page("Gmail: Email from Google").Sync
4 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set uname
5 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Passwd").SetSecure  pwd
6 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebButton("Sign in").Click
7 End Function

Once you are done writing the code, “Save” the function library by choosing the required name and location on your computer.
Note – A function library does not get auto included in any of your tests. You are going to have to do it explicitly.

The following are the steps to associate a function library into your test:

Step #1) Open your test or create a new test

Step #2) Depending on the settings you have on your IDE you might have the resources pane already available to you. If not choose the menu option “View->Resources” and this displays the pane.

Step #3) Right click on the “Associate Function libraries”, click the “Associate Function library” option and choose the library file you created earlier.

QTP Functions

Step #4) There will be a message that asks for the tester’s confirmation before converting the path to a relative path. This is done to make sure that the test does not fail if the files are moved as long as the same hierarchy is followed. Click yes on this dialog box:

QTP Functions

Step #5) It will appear under this node from now and that is how you verify if your association has worked or not.

Step #6) Once you have associated the library make sure you save your test.

From now on if there is a statement in my test that is as follows, it will invoke the function in the library and execute the steps in there.

1 gmailLogin(“swatiseela”,”akihad989080890”)

In the above statement you are passing constant user name and password values. But if you choose to you can pass the values from the data table too.

1 gmailLogin(DataTable("SignInName", dtGlobalSheet), DataTable("GPassword", dtGlobalSheet))

You can have more than one function in your library files and you can have more than one library files associated to your test.


This concludes our Function libraries and Actions.  These two topics are crucial for a tester as they make all your tests more modular and reusable.

The next topic is going to be on Object repositories (OR). We will discuss how to create, associate and work with shared ORs and OR manager.

Overview of SeeTestAutomation – Mobile Automation Testing Tool

Posted on

Mobile applications are being used for just about everything. Among the biggest players in this industry are large enterprises. Every business aims to deliver the most cutting edge version of their mobile application to an ever growing audience of mobile users.

Mobile applications work on multiple platforms, and over all main mobile operating systems. Testing these mobile applications to work flawlessly on multiple device, operating systems, and versions of each requires mobile test automation. A mobile automation testing tool enables the DevOpsteam who built the app to test it faster, while covering a larger test coverage area in the process.

Benefits of SeeTestAutomation:

SeeTestAutomation is among the top tier of mobile test automation tools. It has cross-platform capabilities developed and supported by Experitest to automate native, hybrid and mobile web applications running over Android, iOS, WindowsPhone, and Blackberry. In the last few years SeeTestAutomation has become a leading tool in the market to test the quality of an application. SeeTestAutomation is tested on simulators, emulators, and real devices.

SeeTestAutomation streamlines the automation script process by allowing you to plug in your mobile device, or reserve one from the cloud, and see a reflection of that device on your desktop screen. You launch the app, and perform the steps you wish to test by manipulating the reflection like you would use your mobile device, but this time with your keyboard and mouse.

As you perform a step, SeeTestAutomation will record the step as part of the test script. Once you are done executing the function you wish to test, SeeTestAutomation will have created a full test script. You can then edit the script to include if/then statements or loops. You can also export the script into other testing environments and programming IDE’s. SeeTestAutomation supports Java, C#, Selenium, QTP, UFT, Vugen, Microsoft Visual provigil online buy Studio, IBM RFT, SmartBearTestComplete, Java, Pearl, Python, and Ruby.


Advantages of Using SeeTestAutomation:

There are various advantages of using SeeTestAutomation for mobile application testing:

  • Easy to script –The ability to create scripts by “using” your app makes the process simpler.
  • Easier to resolve bugs and issues –SeeTestautomatically captures logs and information during the bugs report, and automatically attaches to your “Defect Management Solution” (f.e JIRA or Quality Center) device logs, incident video and a full detailed report with screenshots and description that allow developers to reproduce and resolve the issues faster.
  • Runs over all mobile devices and operating systems –You just need one tool to handle your entire test coverage.
  • Enables cloud access – You can rapidly scale up your test automation by running your scripts over a large pool of mobile devices based in SeeTestCloud.
  • Compatible with all major mobile testing environments – Your test scripts can be converted into scripts for Selenium, QTP, Microsoft Visual Studio, IBM RFT, SmartBearTestComplete, Java, Pearl, Python, and Ruby.
  • Works with functional and non-functional testing –Virtualize memory and CPU stress conditions on your mobile device, or simulate the network connection. SeeTestAutomation integrates with HP LoadRunner and allows load and performance end-to-end testing scenarios.
  • Continuous Integration (CI) compatible –SeeTestAutomation fully integrates with a variety of CI tools such as Jenkins, TeamCity, Hudson, Quality Center and many more.


SeeTestAutomation is a vital part of any end to end mobile application testing process. Experitest aims to make the transition from manual to automation as painless as possible by offering support for installation, integration into current systems, and troubleshooting along the way. With its flexibility to other DevOps platforms and all mobile devices and operating systems, SeeTestAutomation is an optimal tool for establishing or enhancing your mobile test automation.

5 Tips To Successful Mobile Testing

Posted on

Being a mobile application tester for more than 5 years, I have learnt a lot about effective mobile testing. In this article, I am going to share my top 5 tips to successful mobile testing. Usually we followed the traditional V model software cycle in which the software was developed and unit tested by the developers before handing over to the test team. As soon as we used to get a new build, we used to run sanity test to make sure the build is stable to carry on the rest of the testing including regression, functional, non-functional and performance testing. Main testing was manual but performance was mainly done using automation.

Based on my experience, below are the 5 tips to successful mobile testing:

Thinking From User’s Perspective:

It is very important to think from the user’s perspective while testing the mobile applications. There could be different types of users using the same mobile for different purposes. For example, a small business owner would need all the apps related to his social accounts so that he can sell his products easily and conveniently whereas a student using the same mobile would prefer to have apps which are more on entertainment side. If you are clear on what your target users would be then thinking from their perspective would make your testing more focused and also would improve user’s experience. I would like to explain this with another small example, say I am testing an app which is mostly be used by user who loves music. I have to make sure that the user do not find any issues related to the quality of the music and the search of his favorite song. Also, I should make sure that playlist created should be saved properly and adding or removing songs should be easy. These were some of the cases when I am thinking from the end user’s perspective. This will not only give me proper directions to test but also help me in improving the overall quality.

Negative Testing Along With Exploratory Testing Is Important:

Before I explain this point, I want to mention the importance of the negative or boundary testing. If we are a mobile tester then we need to have test cases which test the breakpoints or the limit of the mobile device. For example, I had noticed this while testing a music application that after adding like 50 songs to the playlist, adding 51st song made the application crashed, so I knew that 50 is the limit which can be properly handled by the application but there was no notification for the user. Solution was either to increase the limit or notify user about the limit in advance so that he knows what to expect. Negative testing not only gives the clear idea about the expectations about the product but also, helps in knowing the product better and when it is combined with exploratory testing then quality would touch the sky. Exploratory testing gives the freestyle or freedom based approach where there are no pre-written test cases and you can test all the possible test scenarios based on your experience and thinking out of the box.

Performance Comes First:

Mobile is something we carry with us all day along. It is very important to test the performance of the mobile. It includes load, stress, battery and other aspects. Performance is something which makes the major difference. Let me give you some examples, when you go to any online mobile shop and see the user’s reviews, you will find that there would be lot many complains related to battery heat up or device hang up on a particular screen which hugely affects the rating and ultimately the business. People prefer to pay more for a mobile which is high on performance and that makes performance a key factor to test. When you know how much load the device can take or what is the expected battery life then you will have a clear idea what to convey to the users beforehand so that they will not have any surprises afterwards. Loading the mobile memory by 80% and see how it behaves or pressing a key or two like 1000 times and see if mobile works fine under stress. There are many automated performance tools available in the market today which will not only save a lot of efforts of a tester but also gives him more time to focus on different testing areas to maximize the test coverage.

Detailed Bug Reports:

Bug reports are the most important documents when we talk about the quality bugs and fixes. An ideal bug report will have all the key details like severity of the issue, steps to reproduce, expected result, actual result and other details. I have seen bug reports which were not detailed and due to that development team wasted a lot of time in reproducing the issue. When everything is clearly mentioned in the bug report, it becomes easy to find out the root cause and hence, it helps in fixing the bug properly. It would also give an idea about the areas which could be affected by fixing a bug. In short, detailed bug report makes tasks easier for both testing and development teams.

Sanity or Smoke Testing:

We all know how important sanity testing is! While analyzing the requirements and creating test cases, it is very important to know all the key applications and areas which have the highest priority i.e. without which the mobile is useless. For example, start or home screen, power button, home button, volume up and down, scrolling are some of the major areas. If any or more than one area has any issue then the severity becomes the highest and should be fixed as soon as possible. Build should be returned to the development team to fix and no further testing should be performed until the new fixed build is built. To run sanity or smoke test is the first step and to choose proper test cases for the smoke or sanity suite is important.

Mobile testing is not as complex as it seems, important thing is to learn from your experiences and pay attention to details. Users play the most important part here so is the thinking out of the box approach of the tester.

Object Repository Exercise 2: Learn and Save Multiple Object Repositories – UFT

Posted on

In UFT/QTP Training series last article “Object Repository Exercise 1” we presented that how to create a shared object repository for the Welcome page of the Mercury Tours Web site.

In Object Repository Exercise 2, you will get to know how to create a shared object repository for each of the remaining pages in the site. Here, UFT will learn all of the objects on each page, it is not require for you to associate the object repositories with a specific action.

Let us know that how to work on it.

First, visit to the Flight Finder page by log-in into the Mercury Tours Web site.

In IE browser, open the URL: “”. The Mercury Tours Web site welcome page will appear, log-in into the site by giving UserName and Password. Once log-in process done, the Flight Finder page appears.
Object Repository in UFT Excercise 2
Second, generate a new shared object repository.

If the Object Repository Manager is not opened, open it by visiting Resources > Object Repository Manager in UFT. The Object Repository Manager window opens. Once the Object Repository Manager window opens, click on “New”button to open a blank shared object repository.

Third, set the Define Object Filter to open the Navigate and Learn

To open the Navigate and Learn, go to the opened Object Repository Manager window, select Object à Navigate and Learn will hide both UFT and the Object Repository Manager.From the Navigate and Learn toolbar, click the Define Object Filter button. The Define Object Filter dialog box opens.

In the Define Object Filter dialog box displays number of options, select “All object types” option and click “OK”.
UFT Define Object Filter dialog box
Fourth, Learn all objects from the Flight Finder page.

Here, UFT will learn all objects of Flight Finder page of the Mercury Tours Web site that match the filter, and those objects to a shared object repository. In the Mercury Tours Web site, refresh the Flight Finder page to bring it into focus for UFT to learn as the Web page.

Next, use Navigate and Learn toolbar and click “Learn” button. Once we click on “Learn” button, the Web page start flickering and the Adding Objects message box displays to represent that UFT has been started adding properties and values of objects of the Web page to a new object repository.

When objects addition done, close the Navigate and Learn toolbar. As soon as we close the Navigate and Learn toolbar, UFT and the Object Repository Manager window becomes visible.

Fifth, save the shared object repository by click on “Save”, it opens the “Save Shared Object Repository” dialog box. Save the file by giving name of the file, here we have used the file name “MercuryToursFlightFinder.tsr” and click OK.

To generate a new shared object repository for the Select Flight page.

To create new shared object repository, just go down to the Flight Finder page of Mercury Tours Web site and click on “Continuebutton, it takes you to the Select Flight page. Objects can also be added from this page too.

After setting the Select Flight page, go back to Object Repository Manager window and click “New” button. A blank shared object repository opens.

In the Object Repository Manager window, select Object > Navigate and Learn. The Navigate and Learn toolbar opens that hides both UFT and the Object Repository Manager.

Next, go back to the Select Flight page,refresh the page to bring it into focus for UFT to learn as the Web page.

Sixth, generate object repositories for the remaining objects of Web pages.

Using above process, create new shared object repositories for each of the following pages:

  • Book a Flight
  • Flight Confirmation

After creating shared object repositories for both “Book a Flight” and “Flight Confirmation” page. Save “Book a Flight” by giving name “MercuryToursBookFlight.tsr” and Flight Confirmation” by giving name “MercuryToursFlightConfirmation.tsr”.

Seventh, involve the MercuryToursFlightFinder.tsr object repository with the Flight Finder action.

To do so, go back to the UFT window and open Solution Explorer window. In Solution Explorer window, right-click to the “Flight Finder” action and choose“Associate Repository with Action” from the context menu. The Open Shared Object Repository dialog box opens.

Choose the “MercuryToursFlight Finder.tsr shared object repository and click Open.

Next, the “Automatic Relative Path Conversation” message box opens, click on “Yes” for further process.

In the Solution Explorer window, you can see the object repository (MercuryToursFlightFinder) at the bottom of the Flight Finder action, as a child of that action.
UFT Object Repository
Eight, just like above mention process, involve the “MercuryToursSelectFlight.tsrobject repository with the SelectFlight action, and “MercuryToursBookFlight.tsr” and “MercuryToursFlightConfirmation.tsr” withBookFlight action.Shown in the figure below.

UFT Object Repository2
Later, when you add steps to each action, all of the vital test objects will be open for u
Ninth, save the test by clicking on “Save” button.

%d bloggers like this: