Skip to main content

HP QTP Tutorial Chapter 6

“Let me first say sorry to all my readers for such a long wait for Chapter 6. It was totally my fault for such a long wait. I promise to all my readers that now they do not have to wait for so long for next chapter and every month I am going to publish 2 Articles. With this pledge, let get started with Chapter 6.”

1 Checkpoint

In my previous chapter, I touch base with checkpoint but not in great detail. In this Chapter I am going to talk only about Check Points/Verification Points/Validation Points. First I will describe what is a Checkpoint? Let me explain the concept of Checkpoint with an example: See the below scenario with expected result for each step. The third column provides the information on where QTP checkpoint can be used.
Validate the layout of login page
Step1- Navigate to page The user navigated to login page
Step 2- Verify user name input field The User Name field is visible and editable Standard Checkpoint
Step 3- Verify password input field The password field is visible and editable Standard Checkpoint
Step 4- Verify Login button The login button is disabled by default and will be enabled when user name input field contain certain value. Standard Checkpoint
Step 5- Verify Cancel Button The Cancel button is enabled and visible. Standard Checkpoint

You can validate above expected result using other VB Script technique as well but since we are talking about Checkpoint, so we will use Checkpoint to achieve our automation requirement.
To summarize the definition of Checkpoint I will define “Checkpoint as a utility which can be used to implement the validation of our Test cases mainly related to page or form controls.”
Through out this Chapter we will discuss the above test scenario and I will show you the steps for implementing the above checkpoint in your test.
Please find below the List of QTP Checkpoints:
  1. Standard Checkpoint can be used for validating form or page control such as Input Box, Button, Checkbox, Radio Button, Dropdown, Images, Table, Link, Page etc.
  2. Bitmap Checkpoint can be used for validating the images for exact match including screen coordinates etc. This checkpoint takes a screen shot of the page or forms and compares the same while running the test.
  3. Text Checkpoint can be used for validating the expected text/content anywhere on the page or form.
  4. Text Area Checkpoint can be used for validating the text/content on the specified area of the page or form.
  5. Database Checkpoint can be used to validate the expected records and actual records in database for your application. For e.g. you want to validate whether customer information entered by you getting saved in the database. Here you can use Database checkpoint to validate the records. In this Chapter we will not cover database checkpoint in detail.
  6. Accessibility Checkpoint can be used for validating the accessibility guidelines as per W3C standard. This topic will also be not covered in this chapter.
  7. XML Checkpoint can be used to validate the XSDs, XML Document for expected value. This topic will not be covered in this chapter.

 1.1 Standard Checkpoint

You can add standard checkpoint during recording as well as after recording. Please note if you want to add Standard Checkpoint after recording, then you must have enabled Active Screen Capture option. Enabling Active Screen Capture option will save the Page Image which can be used to add Standard and other checkpoint.
The standard checkpoint can be added in QTP by pressing F12 during recording or
Click Insert->Checkpoint->Standard Checkpoint.
As soon as you press F12, the pointer icon clip_image001 will change into hand iconclip_image003.
Click the Hand Icon on the Page, WebEdit, WebTable, WebRadio etc to add Standard Checkpoint. After you click the Page, Browser, Page Elements such as WebTable, WebEdit, WebRadio etc., you will see Checkpoint Properties Window as shown in Figure 1. Using this window you can choose to validate the property as per your Test Cases.
Considering the Test Scenario mentioned in Section 1, let automate:
Step 2- Verify user name input field The User Name field is visible and editable

If you see the expected result, it mentions the input field called user name, the input field should be visible & editable. Considering that this is Web application, the Input field will be WebEdit, the property that need to be validated are Visible and Editable. It means if we validate that Visible and Editable properties are true for User Name Input Box (WebEdit), this test case gets automated.
Have a look onto the property available for WebEdit: (Figure 1)
image
Figure 1
Another important point is that you can add Checkpoint only in Keyword view and it cannot be added in Expert View directly by writing Check CheckPoint("q"). After you add the checkpoint using F12, you can view/edit the checkpoint property by right click and choosing Checkpoint Property.
You can view the checkpoint result in Test Result as shown below:
clip_image008
Since we checked for user name field for enabled = true property, we checked disabled = 0 while defining the checkpoint. The properties which are checked while defining the checkpoint will be visible in Test Result.
Let’s have a quick look on another Standard Checkpoints such as Page, WebTable, WebRadioGroup, WebCheckBox, Link, Image etc.
Scenario Best Checkpoint
Validate that Home page has 100 Links, 50 Images, no broken links and should not take more than 3 seconds to load. Page Checkpoint
Press F12; click the Hand Icon on to page. On the object selection window, select the Page and Click OK. See below:
clip_image010
See below Page Checkpoint properties window. In this window, please define your validation criteria. This expected criterion will be validated against actual result and accordingly the Test Result will be shown.
clip_image012
Note: HTML verification can be used if you want to ensure that expected and actual HTML is same and there is no change in subsequent builds. Also, this option will be enabled when you are inserting Page Checkpoint while doing recording.
Validate that Home Page have User Name, Password Input field – visible and editable.
Validate that Login and Cancel button are visible and enable
Standard Checkpoint
Press F12; click the Hand Icon on to User Name Field. On the object selection window, select the WebEdit:userName and Click OK. See below:
clip_image014
See below Standard Checkpoint properties window for WebEdit. In this window, please define your validation criteria. This expected criterion will be validated against actual result and accordingly the Test Result will be shown.
clip_image016
In a similar way, you can add Checkpoint for other controls such as Link, Images, WebTable, WebCheckBox, WebRadioGroup available on your page.

Please remember the below thumb rule for choosing the Standard Checkpoints – The actionable controls such as input box, checkbox, radio button, button, links, webtable(exception) will make use of Standard Checkpoint. More than 80% of time you should choose to have standard checkpoint rather than any other type of checkpoint.

 1.2 Bitmap Checkpoint

First let me explain you the situation where you are going to use Bitmap checkpoint. Remember use Bitmap checkpoint judiciously as it eats up lot of system resources and slows your test execution.
Suppose, I have a requirement which says “when user will enter the customer name, the customer details will be shown with an image of the customer”. Now to validate that the image loaded onto the page will remain same when we will execute the script, we need to use Bitmap Checkpoint. Why Bitmap Checkpoint, because it uses PbP (Pixel by Pixel) mapping method to validate that images are identical. (Although the validation done by QTP does depend on your machine display drivers).
In real time projects, most of the time we do not use Bitmap checkpoint. But if you have a scenario as mentioned above, you can really use Bitmap Checkpoint.
To insert Bitmap Checkpoint during recording, Goto Insert->Checkpoint->Bitmap Checkpoint. If you have Active screen, then you can add Bitmap after recoding as well: right click on the image and choose Insert Bitmap Checkpoint. Please see below:
clip_image018 clip_image020
The Results of Bitmap checkpoint may vary from run to run and is not very stable.
clip_image022

 1.3 Text Checkpoint

Consider a scenario where you need to validate that the page header on webpage is as per the requirement. For e.g. Validate About Us page have “About Us” header. In such a scenario we can make use of Text Checkpoint. As the name suggests, it will compare the expected Text with Actual Text and show you the result.
To add Text Checkpoint, goto Insert->Checkpoint->Text Checkpoint. Point the Hand Icon to the text which you want to validate and you are done. See below screen shots:
clip_image024clip_image026
You can configure the Text to validate as per your requirement. As far as real time usage is concerned, this is hardly being used in an Automation Project. Text Checkpoint can only be used for Web based application.
The Text Checkpoint detail shown in Test Result is:
clip_image028

 1.4 Text Area Checkpoint

There is no major difference between Text Checkpoint and Text Area Checkpoint apart from the fact that these are 2 versions of same functionality. You can use Text Area Checkpoint for Standard Windows, Java, Visual Basic, and ActiveX. You cannot use the same for Web Based Applications. For web application make use of Text Checkpoint. See the below screen shots:
clip_image030clip_image032
Again this is also hardly being used in real time projects.

 1.5 Database Checkpoint

You can make use of DB Checkpoint where you want to validate the information available in the DB tables are as per Database Specification or not. As you know when we are developing a system, then we are also designing the database. The database contains multiple tables and some tables are having Master Data or Configuration Data. Ideally, the record in these tables is constant and does not change.
If you have such kind of requirement, then you can make use of Database Checkpoint. To create a database checkpoint, you need to know the connection string for database connection, table from where data should be fetched. Goto Insert->Checkpoint->Database Checkpoint. See below screen shot for clarity:
clip_image034
Here you can use either options. If you are aware about Connection String and SQL Statement, then choose 2nd Radio button (preferable). Click Next and below screen will be displayed:
clip_image036
On this screen you need to type in the connection string for database connection. If you are not aware what connection string to use, visit www.google.com and search “connection strings” and use the one as per your need. After connection string is provided, you need to write SQL Statement “select * from Orders”. You can also write conditional query by using “where clause”.
After all above steps, click Finish, if everything goes well, then it will display you below screen shot else will show you error message which needs to be corrected. You can customize the values to be checked by checking and un-checking the cells.
clip_image038
As per my experience I will recommend to use database checkpoint extensively for the automation of any Business Intelligence Project where you have many master tables which need to be validated for data consistency.
The result of DB Checkpoint will be come in the Test Result as shown below:
clip_image040

 1.6 Accessibility Checkpoint

Do you know what accessibility is? If not, then let me explain this terminology for you. Accessibility Testing is a kind of Testing done for websites so that Physically Handicapped people can also use the website for their information. In many countries, there are strict rules which need to be followed by Website owner so that physically challenged people can also browse the website. There is an International body which maintains and published the information on Accessibility and is known as W3C Standard. They have A, AA, AAA as their Accessibility standard. In QTP, this feature provided in the form of Accessibility Checkpoint where in you can validate very few guidelines of accessibility. To add Accessibility Checkpoint for your pages, just start recording, goto Insert->Checkpoint->Accessibility Checkpoint. This checkpoint is available only in record mode and you can define offline if you have Active Screen enabled. See the below screen shot for detail:
clip_image042
I will not recommend Accessibility Checkpoint in QTP for Accessibility Testing but you can use it for checking missing Alt in images, frame titles etc which is a very limited check from accessibility point of view. Accessibility Testing is all together a different Testing discipline and require an altogether different approach.
The Test Result will have the Accessibility Checkpoint detail as shown below:
clip_image044

 1.7 XML Checkpoint

You can use XML Checkpoint as a utility for validating the data in your XML files. Suppose you have a set of XML files which need to be published on the web pages. You want to ensure that the data in these XML files should be checked before deployment onto production, then use XML Checkpoint, take a data snapshot of base XML and then run XML Checkpoint after development and testing is completed. This will give you any data inconsistency from base XML. Apart from that you can also use XML Checkpoint to validate your XML Data is as per the XSD. Overall a good feature but people hardly use it. If you are testing Media Website, which take XML feed from various sources, then you can make use of XML checkpoint as that website run on XMLs. To add XML Checkpoint, Goto Insert->Checkpoint->XML Checkpoint. You will see below screen:
clip_image046
clip_image048
Try to use this checkpoint on Google Reader and you will see what it captures. To use on Website you have to use XML Checkpoint (From application). Almost same as XML Checkpoint (From resources).The former provide the hand icon which need to be clicked on the webpage and then you will get the corresponding page data in the XML format shown in above screen shot.
The Test Result will have the XML Checkpoint detail as shown below:
clip_image050

 2 References

Quick Test Professional Tool.

 3 Additional information

You can email me on Sachin.vasudha@gmail.com with any query.

 4 What Next?

In my next Chapter I will explain the Automation Menu and the usage of various features such as Record, Run, Stop, Run Current Action, Run Mode, Recording Mode etc available under the Automation Menu. Keep checking.

Comments

Popular posts from this blog

Revolutionize software testing with AI! 🤖💻 Share your thoughts on ethical implications in the comments.

  As technology evolves, so too does the field of software testing. One exciting development in recent years is the use of AI (Artificial Intelligence) to automate repetitive tasks and improve testing accuracy. Through analyzing large amounts of data and identifying patterns, AI can help identify potential defects or vulnerabilities in software. AI-powered tools can also generate test cases and scenarios by simulating user behavior and input, allowing for more efficient and effective testing. In addition, machine learning algorithms can analyze and learn from past testing data, leading to better predictions and more streamlined testing. AI-powered tools can also help identify and prioritize critical bugs and defects, saving valuable time and effort in manual testing. But it's important to note that AI-powered testing is not a replacement for human testers. While AI can automate certain tasks and help identify potential issues, it's still necessary for human testers to provide a

Is AI taking over your job in software development and testing? 😱"

Are you a software developer or tester feeling threatened by the rise of AI in your industry? 😰 You're not alone. Many professionals in the field are concerned about the potential consequences of AI's integration into software development and testing. While some experts believe that AI can bring significant benefits to the industry, others worry that it could replace human expertise altogether. 🤔 AI algorithms can analyze massive amounts of data and automate many tasks, but they cannot replace the critical thinking and creativity of human beings. Additionally, there are ethical concerns associated with the use of AI in software development and testing. So, what can you do to ensure that you're not replaced by AI in your job? 💪 First, it's essential to recognize that AI is not a replacement for human expertise but rather a tool to augment it. Therefore, it's essential to learn how to work with AI-powered systems to increase your efficiency and productivity. Additi

HP Quality Center - Best Practices

1.Introduction Quality Center is a test management tool which provides very good features for managing both your manual and automated test cases. This paper highlights the best practices for managing your test cases. When you open Quality center, depending on your rights it display the below mentioned option in the sidebar: 1. Requirements 2. Test Plan 3. Test Lab 4. Defects 5. Dashboard 2.Requirements When you have assigned with the responsibility of developing your test cases in the quality center then you must be wondering where to start with. I am going to share my experience to overcome such a situation. You need to find the solution of some question before you start writing your test cases. 1. Is your requirement developed and available? 2. Is your requirement organized in a logical sequence? If answer to both of the above question is Yes, then you can start with Requirement option in the side bar. In case your requirement is under development, then you keep your