QTP Tutorial #11 – Use of Password Encoder and Active Screen – Explained With Examples

By Vijay

By Vijay

I'm Vijay, and I've been working on this blog for the past 20+ years! I’ve been in the IT industry for more than 20 years now. I completed my graduation in B.E. Computer Science from a reputed Pune university and then started my career in…

Learn about our editorial policies.
Updated November 27, 2024

This QTP tutorial will explain two basic but important features of QTP that are used frequently in advanced QTP scripts. They are the QTP Password Encoder tool and the Active screen. 

For obvious reasons, websites do not display passwords even while we are providing them as an input to sign in. QTP has a unique feature that will preserve the password from being out in the open thereby maintaining the password’s integrity.

=> Click Here For QTP Training Tutorials Series

Use of Password Encoder and Active Screen

QTP Password Tool

As you might have noticed, when we enter the password as “Mercury” in the flight’s application along with an illegible sequence of characters is set in the password edit box.

This is how it looks:

Dialog(“Login”).WinEdit(“Password:”).SetSecure “512c58cda469a14c01aa536f4a1a6a544d7d09e6”

In the above line of code, we can see that the password is encrypted.

QTP records a ‘SetSecure’ method when a password is entered. It automatically encodes the password entered during login and decodes the same while running the test. This is a mechanism that QTP employs to hide the password on the screen.

The user can also choose to enter a value discreetly into a non-password text box by using the SetSecure method and the encrypted equivalent of the text to be entered as a parameter. If a need arises that we need to set a secure value in a certain textbox, then QTP comes with a tool called “Password Encoder”. This tool takes the regular text and encodes it.

The “Password Encoder Utility’ is available at:

Start > Programs > HP QuickTest Professional > Tools > Password Encoder

It launches the following app:

Password Encoder Utility

The tool is very user-friendly and self-explanatory.

When the “Password” field is provided with an input, the “Generate” button becomes active and upon clicking it, the encoded text is displayed in the “Encoded String” field. The same can be copied to the clipboard by clicking on the “Copy” button which gets enabled when the encoded password is generated.

For Example,

Password Encoder Utility 1

Click Generate:

Password Encoder Utility 2

The encoded text can be used as a direct input to a text/edit box or as a parameter in the DataTable.

Active Screen

This is another versatile feature that QTP provides to make the testing process more transparent to the user.  While recording QTP saves a snapshot of the application state when a certain operation was performed on it. The number of details that you want your active screen to store and record depends on the settings.

Before we talk more about the settings and what it means, let us take a look at how the active screen looks.

To view the active screen, click on “View -> Active Screen”.

Here I have a test that creates a Gmail account and I chose to view the active screen. This is how it looks.

Active Screen

As you can see, when I have the statement selected, the corresponding object on which the statement acted upon is highlighted in the snapshot that was captured by the active screen.

Let’s see what happens when I move to the next statement.

Active Screen 1

The corresponding text box where I am trying to enter the First Name is highlighted and as it can be noted this is no longer the Gmail page, it is the ‘create a new Google account’ page.

Now let us see how much information we can ask QTP to store in this snapshot while recording and how do we do it.

Choose “Tools -> Options -> Active Screen” from the menu and it will open up the following window.

Active Screen 2

Each level of capture and its corresponding features are explained in this window. The default setting is as you see it in the screenshot. The levels can be changed as required.

Given below are the levels and what each level means to get displayed as the user sets them.

  • Complete
  • Partial (Default)
  • Minimum
  • None

The capture level can be decreased or increased even after a test is created. Alternately, the user can set a custom level of active screen capture by clicking on the “Custom Level” button and choosing the relevant options.

The active screen, apart from being a visual aid during the examining process, also has several important aspects that can help the tester manipulate the tests as required.

  • Objects in the Active screen can be added to local or shared object repositories.
  • Check-points can be added from this screen.
  • Output values can be added.
  • Parameterization for the fields can also be done from this screen.
  • Steps can be added to the test

For Example, in our Gmail page earlier if I choose to add the ‘Sign in’ button to the repository I can do that by right-clicking on the object and the following options will get displayed for me to choose from.

Active Screen 3

As you can see, I can insert a checkpoint, output value, or choose to view or add objects among other things.

Although we are yet to uncover the checkpoint and output value features, it is inevitable to mention them here, as they are some key functionality that the active screen helps with.

Replacing the active screen for certain steps:

In case a need arises for me to change the active screen that got recorded by default, QTP provides me with a way to do that.

Choose the option “Tools ->Change Active screen” from the menu and QTP lets you go to the new screen. When you click on the new screen, the control goes back to QTP with the following confirmation message.

Active Screen 4

On choosing “Yes” to this message, a new screen will be displayed henceforth when the active screen for that step is viewed.

If all the snapshots in your test have to be replaced or updated, you can choose to run the test in “Update Run mode”. You might be able to guess what this means, but in any case, we will have a detailed discussion on it later on in the upcoming articles.

Active Screen 5

Real-time use of the active screen is when you want to make changes to the test without opening your application but just from the screen captured during the record.

However, it must be noted that tests with Active screen-captured occupy way more disk space than the ones without it. On saving a test using the “Save as” option to exclude, the Active screen will be available to the user.

Active Screen 6

So what you can do is, record a test with an active screen, modify it as needed while leveraging as many features as you can from it, and “Save as” a new test without the active screen. This ensures that your tests are easy on disk space at the same time you get to use the active screen for your benefit while it is needed.

This was some brief insight into the topics, password encoder, and Active screen.

=> Visit Here For QTP Training Tutorials Series

The next article is going to be about Expert view, Step generator, etc., and we will try to include some checkpoints too. Feel free to post your questions in the comments section below.

Was this helpful?

Thanks for your feedback!

Recommended Reading

  • Screen Capture Tools

    Best Screen Capture Software Tools that would enable you to make your workday much more productive: A few years ago, screenshots were not that much popular. It was only used to share the error message on the screen. But, nowadays screenshots are routinely and widely used in our day-to-day life.…

  • Writing Loop and Conditional Statements

    VB Scripting Basics - Writing Loop and Conditional Statements for Building the Programming Logic. => Click Here For The QTP Training Tutorials Series => Also read the complete free VBScripting Tutorial series here In the last VB Scripting article, we saw some of the basic features of the VB script. Here, we…

  • Techniques for Parameterization

    In part 1 of this QTP Parameterization tutorial, we explained Datatable Parameterization with an example. In this QTP tutorial let’s focus on the remaining three Techniques for parameterization in QTP: 2) Random number parameters 3) Environment variable parameters 4) Test/Action parameters => Click Here For QTP Training Tutorials Series #2 -…

  • Parameterization in QTP

    What is QTP Parameterization? Sometimes the application does not accept duplicate data records. In this case, if you run the same Test script with a fixed set of input data, an application may throw an error due to data duplication. To avoid this issue, QTP provides ways to accept different…

  • QTP Tutorials

    Today we are publishing part one of a multi-part guest post series on Micro Focus Quick Test Professional (QTP). In this multi-part QTP training series we'll be covering all QTP tutorials and concepts in detail with adequate illustrations. Our expert author Swati S. will be helping us in bringing this…

  • Using Virtual Objects and Recovery Scenarios

    Do you see an object not found error while running QTP tests? Well, this is because, during playback, QTP can’t recognize non-standard objects. To solve this object recognition problem, we use Virtual Objects. Using Virtual Object Wizard we can map these unrecognized objects to a standard class which can then…

  • Using Text Area, Table, and Page Checkpoints

    In the last article, we were discussing the ways in which QTP can compare text. We also saw how standard checkpoints can be used to check the text and discussed the text checkpoint in detail. The next checkpoint is the Text area checkpoint. Let’s begin exploring it. => Click Here For…

  • Object Repository

    Object Repositories in QTP and Object Repository Manager This tutorial will focus on QTP Object Repositories. In our previous articles, we have discussed how QTP identifies and stores objects in a warehouse, the OR. We have also seen how the object properties appear in the OR. To quickly recap, we…


12 thoughts on “QTP Tutorial #11 – Use of Password Encoder and Active Screen – Explained With Examples”

  1. if Agent Name is Rajat then how we can verify it without using checkpoints.
    I know it can be done via if else but I don’t know the syntax

    Reply
  2. In the trial version i couldnt find the password encoder and the active screen settings as well .. can you please give the modified link ?

    Reply
  3. Does recording under active screen allow to add steps for all objects even if the application is not available at the time of adding more steps to script?

    Reply
  4. while working on QTP i do heard that there is a way to decode the paswword as well.. can you help me with remembering tha..please

    Reply
  5. my objects are visible but not in the active screen. I need to swipe down or up for QTP to change everytime. Is there any method for that i can make the object in active screen and perform operation.

    Reply
  6. i wrote this
    browser(“Gmail”).Page(“Gmail”).WebEdit(“Email”).Set “testergowri@gmail.com”
    wait 2
    a= “sankar”
    browser(“Gmail”).Page(“Gmail”).WebEdit(“Passwd”).Set a

    Reply

Leave a Comment