In this tutorial, we will continue with the remaining QTP checkpoints which are XML, Accessibility, and Database Checkpoints. This is the final tutorial on QTP checkpoints. We have already covered the details of all QTP checkpoints in the previous 4 tutorials.
Recommended IPTV Service Providers
- IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
- IPTVRESALE – Rating 5/5 ( 200+ Reviews )
- IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
- IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
- IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
- IPTVTOPS – Rating 5/5 ( 43 Reviews )
By including XML checkpoints in your test, you can verify the contents of individual XML data files or documents that are part of your Web application.
- XML checkpoints can be applied to XML documents within web pages or frames, XML files, and test objects that support XML.
- An XML checkpoint compares the current value of a specified XML element, attribute, and/or value with the expected value.
- During checkpoint insertion, QuickTest adds a checkpoint step in the Keyword View and adds a Check CheckPoint statement in the Expert View.
- When the test is executed, QuickTest compares the expected and current results of the checkpoint. If they don’t match, the checkpoint fails.
There are three types of XML checkpoints you can create:
- XML Web Page/Frame Checkpoint: Checks an XML document within a web page or frame.
- XML File Checkpoint: Checks a specific XML file.
- XML Test Object Checkpoint: Checks the XML data for an object or operation.
The process to insert this checkpoint is similar to the other ones.
Step #1: While recording, select Insert -> Checkpoint -> XML checkpoint (from application) option
Step #2: Select the page where you want to insert the checkpoint.
Step #3: The following screen will appear:
Step #4: Set the desired values on this screen and click OK
– This statement will be inserted.
Alternatively, if you want to insert an XML checkpoint on a file on your machine, you can choose the option:
“Insert -> Checkpoint -> XML checkpoint (from resource)” and select the XML file test object.
The subsequent steps are similar to the ones mentioned above.
The option “XML checkpoint (from the application)” is only available when the web add-in is present and loaded for a specific test.
You can utilize this checkpoint only when the web add-in is available and loaded. It verifies whether the areas on a website comply with the Web Accessibility Guidelines established by the World Wide Web Consortium.
You can add it during recording or editing through the active screen.
The properties verified by the Accessibility Checkpoint are:
- Active X check
- Alt property check
- Applet check
- Frame titles check
- Multimedia check
- Server-side Image check
- Tables check
The tester can choose to examine one or more properties from the list above.
The settings can be modified from the menu option “Tools -> Options -> Web -> Advanced -> Accessibility”. Options can be checked or unchecked as needed.
To insert the checkpoint, start recording a test. In this case, I am opening the gmail.com page by setting the URL properties in the record and run settings instead of doing it programmatically. As soon as the Gmail.com page opens, I select the menu option “Insert -> Checkpoint -> Accessibility checkpoint” and click on the page.
The following screen will appear:
Select the page object and click OK. The available properties to check will be displayed for the user to select one or multiple options. Additionally, the message at the end of the property selection explains the basis on which the default selection is made.
Let’s take a look at the selected options in the “Web -> Advanced” section of the Options dialog box.
This explains why the only option selected by default in the “Accessibility Checkpoint Properties dialog box” is the “Alt Property check”. If different options are selected in the Web -> Advanced section of the Options dialog box, it will be reflected in subsequent Accessibility checkpoints included in the test.
Click OK on the Accessibility Checkpoint Properties dialog box. As with other checkpoints, the following statement will be added to your test.
Browser("Gmail: Email from Google").Page("Gmail: Email from Google").Check CheckPoint("Gmail: Email from Google")
You can modify this statement just like any other checkpoint from the Object Repository, and the test results will indicate a pass if the check is successful or a fail if it is not.
You can choose to add a default check to every web page you access by enabling the option as shown in the following screenshot.
The Database checkpoint functions by defining a query in your database and creating a DB checkpoint to verify the results of the query, thus detecting defects.
There are two ways to define a Query:
#1) Microsoft query – You can install Microsoft Query from the custom installation of Microsoft Office.
#2) Manually write a SQL query.
I have created a Microsoft Access table called “Contacts” and added a row with my information. Here is how the table looks:
To place a database checkpoint on this table, follow these steps:
Step #1: Select “Insert -> Database Checkpoint” from the menu.
Step #2: In the subsequent screen, choose the “Specify SQL Query manually” option and click “OK”.
Step #3: You need to create a connection string, so click “Create” on the screen.
Step #4: If you already have a DSN created, select it from the screen below.
Step #5: If you don’t have a created DSN, you can create one by clicking on the “New” button and selecting your database type from the available list. In my case, I am choosing “Microsoft Access Driver (.mdb, .accdb)” from the list.
Step #6: Click Next and browse to the location where you want to save this DSN. I am choosing the desktop and clicking OK. On the next screen, click Finish.
Step #7: In the screen below, you can choose the data source, i.e., the database on which you want to run the query. Click Select and browse for your database.
Step #8: Choose your database and click OK. The newly created DSN will appear on the list. Select it from the screen below and click OK.
Step #9: Your connection string is now created. Now, enter the SQL query. For simplicity, I’m using “Select * from Contacts” and clicking Finish.
Step #10: The results of your query will be displayed in the “Database Checkpoint Properties” dialog box, as shown in the following screenshot. You can choose to check for a single column-row combination or multiple ones based on your preferences.
All the other options are self-explanatory. For more complicated scenarios, you can parameterize the expected results.
Step #11: The settings tab can be used to configure the value match criteria.
Step #12: The Cell identification tab allows you to specify how QTP should identify rows and columns.
Step #13: After configuring the properties, the following statement will be added to your test.
Step #14: The test results will display any deviations between the expected and actual results when the test is executed.
This concludes the QTP checkpoints. Feel free to post your questions and comments.
Don’t miss the upcoming important tutorials on Automation Frameworks. In the next couple of tutorials, we will discuss different types of Test Automation Frameworks with examples. Before that, make sure you have gone through all the tutorials published so far.