Welcome to the twelfth lesson in our comprehensive Quick Test Professional tutorial series.
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 )
In this lesson, we will delve into the Expert View and Step Generator, along with a basic understanding of Checkpoints. We will explain these aspects in detail and illustrate how to use these features in real script recording.
=> Check Out Our Series on QTP Training Tutorials Here
Unveiling QTP’s Expert View
- The Expert View displays the actions performed on the Application Under Test as VB Script code.
- Every line of code in this view is represented in the Keyword View.
- The view provides an action drop-down box that allows users to access, view, and modify various actions in the test.
- This view is primarily beneficial for users with a good knowledge of VB script programming.
- The Expert View aids in the creation of functions and function libraries – a crucial feature.
- Users can print the test or function library as seen in this view via the File -> Print option.
Here’s what the Expert View looks like:
Instructions can either be directly typed into the Expert View or added using the Step Generator.
Understanding Step Generator
- The Step Generator is a QTP feature that makes it simple for users to incorporate programmatic steps into QTP.
- Users can utilize the Step Generator in the Keyword View, function library, Active Screen, or Expert View to produce steps.
- The Step Generator can be used to write steps into a test or a function library.
- To access the Step Generator, go to “Insert -> Step Generator” in the menu. Right-click the desired spot for the step and choose “Insert Step -> Step Generator” or press F7 (except in Active Screen).
Example:
Suppose we want to navigate to www.gmail.com and click on the “Create Account” link. In the Step Generator, the corresponding statement would look like this:
Browser("Gmail: Email from Google").Page("Gmail: Email from Google").Link("Create an account").Click
If we want to validate the existence of the link before clicking it, we can use the Step Generator to insert a step before the above statement.
Here’s the step-by-step guide:
Step #1: Determine where the new step should be inserted.
- Expert View: Move the cursor to the required position and open the Step Generator.
- Keyword View: Choose the step below which the new step should be added.
- Active Screen: Right-click in the active screen window, select Step Generator, and select the object for the step. The Step Generator window will appear.
Step #2: The Step Generator window appears, displaying the details of the currently selected steps. Although these details do not affect the current step, they can be utilized as a reference for defining the values for the new step.
In this example, we chose “Create an account” link as the Test Object and “Exist” as the operation. We left the arguments field blank since it is optional and chose to save the return value of the operation in the variable var_Exist. The “Generated Step” field illustrates how the VB Script statement will appear in the Expert View.
Step #3: The “Object” field allows choosing between a test object, utility object, or function as the base for the step.
Step #4: The “Operation” field enables choosing the suitable method, property, or function.
Step #5: The “Arguments” and “Return value” fields need no further explanation; they can be parameterized or assigned fixed values.
Step #6: Users can decide to insert multiple statements by enabling the “Insert another step” option.
Step #7: Once the desired settings are determined, click OK to insert the statement.
var_Exist = Browser("Gmail: Email from Google").Page("Gmail: Email from Google").Link("Create an account").Exist Browser("Gmail: Email from Google").Page("Gmail: Email from Google").Link("Create an account").Click
Delving into Checkpoints
Checkpoints represent logical points in a test where verifying a match between an expected and actual value in the Application Under Test occurs.
QTP offers various checkpoint types, enabling users to create custom checkpoints to include verification points in their tests.
Some noteworthy details about checkpoints:
- When a checkpoint is added, QTP adds a “Check CheckPoint” statement in the Expert View and respective row in the Keyword View.
- The user can choose whether the checkpoint should return a boolean value indicating the result.
- By default, the checkpoint’s name is the object name; however, this can be customized.
- When the expected value aligns with the actual value during the test execution, the checkpoint passes, and if not, it fails.
- The results can be viewed in the Run Results Viewer.
QTP brings along 10 in-built checkpoints:
- Standard Checkpoint
- Image Checkpoint
- Bitmap Checkpoint
- Page Checkpoint
- Text Checkpoint
- XML Checkpoint
- Text Area Checkpoint
- Table Checkpoint
- Accessibility Checkpoint
- Database Checkpoint
Checkpoints are often added after the initial test steps are formulated, but they can also be added during recording or editing.
It is recommended for testers to fully comprehend all the available checkpoints to select the most suitable one for specific tasks.
=> Navigate Here for the Series on QTP Training Tutorials
In the forthcoming article, we will delve into the specifics of each checkpoint and learn how to harness their power effectively.