Skip to content

Iptv Assist

Learn More from us

Menu
  • HOW TO
  • Firestick
  • Chromecast
  • PC Apps
  • Lg Smart TV
  • IPTV Services
  • Automation Testing
  • Smart TV
  • Software Testing Tools
  • Contact Us
Menu

Parameterization in QTP (Part 2) – QTP Tutorial #20

Posted on March 19, 2023

Best Iptv Service Provider 2023 With 40k+ Channels And 100k+ VOD . 24/7 Suppport . Paypal Supported

In part 1 of this QTP Parameterization tutorial, we explained Datatable Parameterization with an example.

Best Iptv Service Provider 2023 With 40k+ Channels And 150k+ VOD . Hurry Up

In this QTP tutorial let’s focus on the remaining three Techniques for parameterization in QTP:

Recommended IPTV Service Providers

  1. IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
  2. IPTVRESALE – Rating 5/5 ( 200+ Reviews )
  3. IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
  4. IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
  5. IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
  6. IPTVTOPS – Rating 5/5 ( 43 Reviews )

 

2) Random number parameters
3) Environment variable parameters
4) Test/Action parameters

=> Click Here For QTP Training Tutorials Series

Techniques for Parameterization

What You Will Learn:

  • #2 – Parameterization in QTP Using Random Number
  • #3 – QTP Parameterization Using Environment Variables
    • 3 Types of Environment Variables
  • #4 – QTP Parameterization Using Action and Test Parameters

#2 – Parameterization in QTP Using Random Number

If a certain field needs to have any number within a certain range you can specify the same using QTP.

In the Value configuration properties screen, select “Random number” and the following options come up:

QTP random number parameterization

As you can see, the options are pretty self-explanatory. The range can be set and how many times during a particular iteration run or a test run should this value be generated can be programmed here.

Let’s just keep the default settings, click OK and see a line of code that gets inserted.

 Browser("Google").Page("Google").WebEdit("q").Set RandomNumber("p_Text") 

In real-time, this is a very useful feature that can help the tester automate the scenarios in which the numeric range of data needs to be verified.

#3 – QTP Parameterization Using Environment Variables

The environment variable is a value that remains the same throughout a test run unless explicitly changed by the program.

3 Types of Environment Variables

  1. User-defined internal
  2. User-defined external
  3. Built-in

We will start with built-in variables because that is the simplest.

Built-in variables are created by QTP itself and contain information about the test path, operation system, etc. These are read-only and hence can only be used by the user as they are.

Some examples include TestIteration, OS, OSVersion, etc. The usage is similar to the usage of any other variable. For example, in the second iteration of a test, if you want to display a custom message, then this is how you can do it:

If TestIteration=2
Msgbox “Cusotm message: Take a break!”
<….Code….>
End if

Next, let us try to parameterize a certain value with an Environment Variable.

QTP Parameterization using Environment variables

From the above screen, you can see that the type is read-only and we are only able to create a User-defined- Internal Environment Variable.

Click on the “Name” Dropdown box.

QTP Parameterization using Environment variables

Even though we have not created any environment variables in this test, so far, there are many of them available in the drop-down to be used.

Select any one of them:

QTP Parameterization using Environment variables

It shows that the variable is built-in and read-only. This shows how we can use a built-in variable.

If you need a new one, enter a new name, say PV assign 0, and save it.

QTP Parameterization using Environment variables

Let us first accept the default values and enter a “0” in the Value field and click OK. The following is the line of code that gets inserted:

 Browser("Google").Page("Google").WebEdit("q").Set Environment("PV") 

Since we inserted an E.V. it is obvious that the value of PV is going to be 0 throughout the test. Next time you are trying to parameterize anything else with an environment variable within the test, then this one will be available on the list.

User-Defined – External:  In the case when we need to have an entire list of environment variables available for a test, the user has the option to create it externally and associate it with the test and make those variables available to this test.

Typically, this file is a .xml with the following structure and is available on your desktop:

<Environment>
<Variable>
<Name>First Name</Name>
<Value>Swati</Value>
</Variable>
<Variable>
<Name>Last Name</Name>
<Value>Seela</Value>
</Variable>
</Environment>

Once this is set up, we can add this file to the test by going to “File -> Settings -> Environment” and selecting “User-defined” from the drop-down.

QTP Parameterization using Environment variables

On the screen, you can see the option to add the file, so go ahead and add it.

Alternately, if I need the variables in this test for another one, I can export them into a file by clicking on the “Export” option.

So now that we know how to set and use environment variables, there is yet another use for these.

In case, we set the values for URL_env and Browser_env variables, then the record-and-run settings are set to overrun and no matter what you set there, it is going to consider the values that these variables contain.

#4 – QTP Parameterization Using Action and Test Parameters

We know that a test in QTP but a call to action. Input parameters for action or test are nothing but the values that get supplied to them from elsewhere in the test.

They could be:

  1. Value(s) passed on while calling for that action.
  2. Return value of another action (Output parameters)
  3. The value that it gets from some top-level action.

Output parameters are the return values of an action that can be used later in the test.

The ways these can be used to parameterize are as follows:

These can be used as a parameter by using the “Parameter” keyword.

If this is the statement that you need to parameterize, so that the value you set is not a constant “Swati” but a value that is the input value of an action that is already defined, say “OPFirstName”.

Browser("Gmail: Email from Google").Page("GoogleAccounts").WebEdit("FirstName").Set "swati”

This is how it is done:

Browser("Gmail: Email from Google").Page("GoogleAccounts").WebEdit("FirstName").Set Parameter(“OPFirstName”)

Also, if there is an output parameter that is already defined then you could also write something like:

Parameter("TotalValue") = Browser("Gmail: Email from Google").Page("GoogleAccounts").WebEdit("FirstName")

Now let us see how the i/p or o/p parameters can be set in the first place. Let’s start with action.

You can define, modify, and delete the input and output parameters in the Parameters tab of the Action Properties dialog box (Edit -> Action -> Action Properties or right-click action and select Action Properties).

QTP Parameterization using Action and test parameters

Similarly, for the test, the parameters can be set.

QTP Parameterization using Action and test parameters

So, to call an action with the input parameters, this is the statement that needs to be used:

 RunAction ActionName, IterationQuantity, Parameters 

This concludes our parameterization in the QTP topic. Out of all that we have discussed in these 2 articles, the one that we use the most is the data table option. So, please take some time to write a test and run it with all the iteration options to get a grip on this topic.

=> Visit Here For The QTP Training Tutorials Series

As always, please let us know your comments, and feel free to post your questions. Upcoming topics are actions, functions, and some error handling methods.

Related

Best Iptv Service Provider 2023 With 40k+ Channels And 150k+ VOD . Hurry Up

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • IPTV List: Best iptv lista 2023
  • IPTV Premium: Best Premium IPTV Service Provider List And Benefits
  • Nikon IPTV Review: Over 10,000 Live Channels for $12/Month
  • Iptvwings. Com Review: +18000 Live IPTV Channels ,+70000 Movies, +40000 TV show For $15/1 month
  • IPTVUNO Review: More Than 16000 Live TV channels, 55,000 Movies & VOD For $15/Month

Recent Comments

  1. IPTV List: Play lista iptv 2022 - Iptv Assist on Best IPTV Player in 2023 for Watching Live TV
  2. Cola IPTV – Over 18,000 Live Channels for $12/Month - Iptv Assist on FileLinked – How to Install on Firestick/Fire TV and Android Devices
  3. Cola IPTV – Over 18,000 Live Channels for $12/Month - Iptv Assist on 50+ Best IPTV Service Providers for Streaming Live TV 2023
  4. XoomsTV IPTV – Over 11,000 Channels & VOD for Under $13/Month on Best VPN for IPTV in 2023 and How to Install on Firestick/Android
  5. Voodoo Streams IPTV Review – Over 12,000 Channels for $11/Month - Iptv Assist on Dynasty TV IPTV Review – Over 6,000 Channels for $10/Month

Archives

  • March 2023

Categories

  • Activate
  • Agile Testing
  • Alternatives
  • Android
  • APK
  • Apple TV
  • Automation Testing
  • Basics of Software Testing
  • Best Apps
  • Breakfast Hours
  • Bug Defect tracking
  • Career in Software Testing
  • Chromebook
  • Chromecast
  • Cross Platform
  • Database Testing
  • Delete Account
  • Discord
  • Error Code
  • Firestick
  • Gaming
  • General
  • Google TV
  • Hisense Smart TV
  • HOW TO
  • Interview Questions
  • iPhone
  • IPTV
  • IPTV Apps
  • Iptv Service SP
  • IPTV Services
  • JVC Smart TV
  • Kodi
  • Lg Smart TV
  • Manual Testing
  • MI TV
  • Mobile Testing
  • Mod APK
  • newestiptv.com
  • News
  • Nintendo Switch
  • Panasonic Smart TV
  • PC Apps
  • Performance Testing
  • Philips Smart TV
  • PS4
  • PS5
  • Python
  • QA Certifications
  • QA Leadership
  • QA Team Skills
  • Quality Assurance
  • Reddit
  • Reviews
  • Roku
  • Samsung Smart TV
  • Screenshot
  • Selenium Tutorials
  • Sharp Smart TV
  • Skyworth Smart TV
  • Smart TV
  • Soft Skills For Testers
  • Software Testing Templates
  • Software Testing Tools
  • Software Testing Training
  • Sony Smart TV
  • Sports
  • Streaming Apps
  • Streaming Devices
  • Tech News
  • Test Management Tools
  • Test Strategy
  • Testing Best Practices
  • Testing Concepts
  • Testing Methodologies
  • Testing News
  • Testing Skill Improvement
  • Testing Tips and Resources
  • Toshiba Smart TV
  • Tutorials
  • Twitch
  • Types of Testing
  • Uncategorized
  • Vizio Smart TV
  • VPN
  • Web Testing
  • What is
  • Xbox
©2023 Iptv Assist | Design: Newspaperly WordPress Theme