If you haven’t seen Part 1 of Intuit Tank, I suggest that you check it out before reading this entry.

One of the cool features about Intuit Tank™ is its ability to interact with automation workflows. One of the key features is Script Filters and Script Filter Groups. Filters allow a raw recording to be transformed based on either rules or custom Javascript. Let’s look at a common use case and how we would use filters to solve the problem.

Let’s say that we use a selenium script to record a flow in our web app that we want to use in a perf test. We want to make the following changes to the script when we import it.

  • Change www.mysite.com host to perf.mysite.com

Click on the link at the top to go to the Filters and Filter Groups page.

  • Click on the button for a new filter

  • Name the filter change host

  • Click Add Condition and set the scope to Hostname, the Condition to

Matches, and the value to www.mysite.com and click Add

  • Click Add Action and set Action to replace, scope to host, and value to

perf.mysite.com and click Add

  • Click Save to save this filter

Note: If you want to make this script more flexible, set the value to a variable instead of the perf.mysite.com by setting the value to #{hostname}. You can then set the variable in the project where the script is used and can determine the environment when you run the test.

Now you can select this filter when you import your raw recordings either from the UI or in the REST API.

For more on filters see the user guide at https://github.com/intuit/tank/wiki/UserGuideFilter

Intuit Tank™ is an open source tool used by performance engineers to load test websites. I would love for you to download it and try it out and send me feedback via the comments section or to intuit.tank@gmail.com. My personal blog is at https://denisangleton.wordpress.com where I write about Tank and other coding issues. There is a stand alone installation that can be used to test the interface locally and see how it works. Check it out at https://github.com/intuit/tank

About Denis

Denis Angleton is a Senior Developer at Intuit’s Automation and Tools team. He is the tech lead for a recently launched open source application, Intuit Tank™, a Load testing tool as well as a suite of cloud-based automation and analysis tools for Performance testing at Intuit. Denis has over 15 years experience designing and developing Enterprise applications. He holds a Master’s Degree in Education Technology from California State University, San Diego.