Book Image

JMeter Cookbook

By : Bayo Erinle
Book Image

JMeter Cookbook

By: Bayo Erinle

Overview of this book

Table of Contents (16 chapters)
JMeter Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using User Defined Variables (UDV)


User Defined Variables (UDVs) are a great way to make test scripts more dynamic and robust. They allow you to define an initial set of variables, which can then be referenced in your test plans. When used with JMeter functions such as __P(), they provide a means to update initially defined values from the command line without needing to modify the test script. Features such as this allow you to record a script against one environment (for example, a development environment) and then run it against a different environment (for example, Functional Test, UAT, and STAGE) at a later time. Also, UDVs allow you to extract common elements within your test plan into a centralized location, which makes your scripts a lot more maintainable.

All UDVs are evaluated at the start of the script regardless of where they are placed in the test plan. As a result, they cannot reference variables that are defined as part of the test run such as variables set during postprocessors...