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

Writing Test scripts through Ruby DSL


Sometimes, it is helpful to manually write your scripts instead of recording them. Cases such as integrating your test plans with a continuous integration build server, or being able to debug your test plans from the comfort of an Integrated Development Environment (IDE) benefit mostly from this.

Thankfully, there is a Ruby gem that provides a readable and concise DSL, allowing you to write test plans using the Ruby programming language.

How to do it…

In this recipe, we will go over how to do just that. Perform the following steps:

  1. Install Ruby on your system by following the instructions given in Appendix, Installing Supporting Software Needed for the Book.

  2. Install the JMeter DSL Ruby gem by running the following on the command prompt:

    • For Mac OS:

      	sudo gem install ruby-jmeter
      
    • For Windows:

      	gem install ruby-jmeter
      
  3. On successful gem installation, you will see lines similar to the following code:

    Fetching: mime-types-2.1.gem (100%)
    Successfully installed mime...