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:
Install Ruby on your system by following the instructions given in Appendix, Installing Supporting Software Needed for the Book.
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
On successful gem installation, you will see lines similar to the following code:
Fetching: mime-types-2.1.gem (100%) Successfully installed mime...