
Learn the basics of Scala, a scalable language that blends object-oriented and functional programming, interoperates with Java, and offers type inference for concise code in Gatling projects.
Learn Scala by building a use case to calculate an electricity bill, using a rate of ten cents per unit, in performance testing with Gatling.
Create a Scala project in IntelliJ with Java 8 and the Scala plugin, then add a Scala worksheet named ecBill to get instant feedback and begin coding.
Define variables in Scala with var and val, showing unitsConsumed as int and bill as inferred double, and illustrate mutable vs immutable constants like rate.
Explore Scala type hierarchy, showing how double sits above int, how a list of double and boolean resolves to AnyVal, and how a boolean and string list resolves to Any.
Explore how tiered unit brackets with varying rates affect electricity bill calculations, introducing new concepts for the Gatling use case.
Explore decision statements in Scala for performance testing with Gatling, using if-else and match guards to calculate a bill from units consumed with a single rate.
Explore writing functions in Scala, including defining parameters and return types, creating single-statement and default-valued functions, and using higher-order functions to calculate and display a bill.
Define a Scala class with a primary constructor, create a generate bill instance in main, and use higher-order functions to display and calculate the bill with a Scala singleton object.
Create and organize packages in scala, move a class into a package like electricity bill, and import classes from java.util using single, multiple, and wildcard imports.
Explore error handling in Scala using try, catch, and finally, with examples of arithmetic exceptions, multiple catch cases, and a finally block that always executes.
Master string interpolation in Scala with s, f, and raw to embed variables and expressions in strings. Apply formatting, taxes, and literal escapes in a practical electricity bill example.
Choose latest Gatling version and install 64-bit OpenJDK 8 or 11 with hotspot, set JAVA_HOME and PATH, verify Java in the command prompt, and prepare for downloading the Gatling bundle.
download the latest Gatling bundle from getting.io, extract it, explore the folder structure (bin, conf, lib, results, simulations, resources, target), and prepare to run Gatling tests and view reports.
Verify a standalone Gatling environment by validating the java home variable, running gatling.bat, and executing sample scripts to generate aggregated metrics and a detailed report in the results folder.
Learn how Gatling recorder uses http proxy to capture requests and responses, configure port 8000 and certificates, and record scripts in converter and http proxy modes.
Record Gatling scripts using har converter to generate them from http archive files captured in Chrome or Firefox network tab, then import the file into Gatling recorder UI.
Explore a Gatling recorded simulation script to understand Gatling DSL, Http protocol configuration, headers, scenario creation, and load injection using a Scala-based approach.
Edit the recorded Gatling script at a superficial level, remove unneeded resources and optional headers, keep the base URL, rename requests, then run and review the global and request-level reports.
Set up Maven by ensuring a JDK is installed and JAVA_HOME is set, then download and extract Apache Maven, add its bin to PATH, configure M2_HOME, and verify mvn -version.
Install and configure Gatling project with Maven command line by generating a Gatling archetype via mvn archetype:generate and exploring the pom.xml, scala, and resources structure.
Configure Gatling script development environment by setting Scala SDK to version 2.12, validating IntelliJ project, and marking test sources, then use the recorder to create a first script.
Run a recorded Gatling script from the integrated development environment, stop the recorder, and launch the engine to verify a single script while not viewing the report this time.
Build a basic Gatling script by configuring the http protocol with a base URL, creating a scenario with two requests and a pause, and injecting load in a simulation.
Learn how to add checks in Gatling, validate response status, time, and content with the check API, combine multiple criteria, and use feeders to vary test data.
Learn to add a csv feeder in Gatling to supply dynamic brewery IDs per user, using a csv file with eager loading and circular strategy, injecting data into requests.
Explore printing and inspecting Gatling session data to debug scripts, understand virtual user state, and see how feeders inject brewery IDs for multiple users.
Learn to inject and save the response body into session using check save as, then print it with the session API to debug and reuse values for subsequent requests.
Implement conditional execution in Gatling by running a second request only when the response contains a string, after saving the response body, using do if or else and session expressions.
Explore how sessions identify distinct users with clientid and sessionid during load testing, and how Gatling injects and extracts data via check API, feeder, Gatling EL, and session API.
Create a Gatling base script to test a rest api, using Goibibo bus details endpoint, configure base url and keys, build a get request, enable logback verification, and inject users.
Inject session data into virtual users using Gatling feeders, leveraging csv and other formats with circular data feeding to populate source and destination in each user session.
Explore Gatling's check API to extract response data using JSON path and find and findAll. Save extracted values into session attributes with saveAs, enabling later use in the scenario.
Fetch session data with the session API in Gatling and access a saved attribute using dot notation and typecast. Use as, asOption, and validate to handle correct and incorrect access.
Explore injecting dynamic values in Gatling requests with expression language, accessing session attributes to drive a subsequent request that uses a captured search key to fetch seat layout and availability.
Inject data into a Gatling session with session.set to store multiple attributes, then use findAll to extract hotel ids from city id responses and reuse them via Gatling EL strings.
Learn to post request bodies in Gatling with formParam and the body method, using a Rebrandly API example to post destination, tag, and title.
Use the rawFileBody method to post data from a JSON file in bodies, configure http conf with base URL and headers, and run a create link Gatling scenario.
Learn how the string body method in Gatling post requests accepts raw, string, or EL expressions to handle dynamic values using StringBody.
Demonstrate using the el file body method in Gatling to post dynamic data from a json file, with feeder and session attribute for destination, tag, and title.
Learn to craft post request bodies using Gatling's StringBody with expressions, integrating dynamic data from CSV via Scala strings, session attributes, and raw interpolation for accurate payloads.
Generate random strings for the request body to ensure unique destination, title, and slash tag, replacing hard-coded values with feeder-driven dynamics and a helper function.
Demonstrates building a custom feeder with an iterator continually to generate dynamic title and tag session attributes, then injects them into a Gatling request string body using Gatling EL strings.
Explore how Gatling supports HTTP, WebSocket, SSE, and JMS protocols, and compare WebSocket with HTTP. Build Gatling scripts for WebSocket and SSE applications as you progress on this journey.
Learn how WebSocket enables real-time bidirectional updates by upgrading http with a handshake and a persistent tcp connection, while identifying ws usage via 101 handshake.
Learn to build a Gatling websocket script for a demo echo application, covering http configuration, websocket entry, sending and receiving messages, and blocking checks with awaits.
Compare server-sent events with websockets, showing how SSE uses HTTP to deliver real-time updates. Demonstrations with emoji trackers and live stock updates illustrate the event-source workflow and client-side handling.
This lecture demonstrates building a Gatling SSE script to consume server-sent events from a stock price feed, including connect/close, checks with regex and jsonpath, and repeating data extraction.
Discover how Gatling uses injection profiles for open and closed systems, controlling arrival rates and concurrent users to model realistic load and advanced simulations.
Learn how to model open system Gatling workloads by arrival rate, with ramping, constant per second, and advanced steps such as at once, nothing for, and heaviside.
Define closed injection profiles to control concurrent users and queue them when capacity is reached, using constant and ramp concurrent steps to create staircase patterns.
Explore Gatling throttling to control requests per second with reachRps, jumpToRps, and holdFor, and apply throttle at simulation or scenario level as a throughput bottleneck.
Integrate Gatling into continuous integration and delivery pipelines using Git, Maven, and Jenkins to automate build, test, and deployment.
Divide and conquer a Gatling workflow by creating a Maven project, running Gatling from the command line, and pushing to GitHub. Install and configure Jenkins to run the Gatling project.
Ensure your Gatling project uses maven, with a pom.xml that includes the Gatling maven plugin and the Gatling high-chart dependency to run simulations and generate high-chart based reports.
Run gatling performance tests from the command line using maven, specify the simulation class with -Dgatling.simulationClass, and execute gatling:test to integrate with Jenkins and IntelliJ IDEA terminals.
Push your Gatling project to git by installing git, initializing a repository, adding files, committing, creating a GitHub repository, linking with origin, and pushing.
Download and install Jenkins from jenkins.io, choose the LTS version, run java -jar jenkins.war to extract, unlock at localhost:8080, install plugins, create a user, and launch Jenkins for Gatling integration.
Configure Jenkins to run Gatling tests by installing the Gatling plugin, linking a Git repository, and setting a poll SCM trigger, then view reports and enforce failures via assertions.
Explore how to scale Gatling scripts by building a reusable framework that boosts readability and maintenance for big projects with multiple scenarios.
Enhance framework reliability by implementing error handling with retry logic for getHotelList, exit on persistent failure, and using before/after hooks, debugging flags, and cache clearing.
Learn how to run Gatling performance tests from multiple locations by creating an uber jar, deploying it across machines, triggering remote runs, and aggregating results.
Run multiple scenarios in parallel by adding a new scenario with its injection profile in the setup. Gatling runs each scenario’s requests sequentially while parallelizing scenarios; adjust timeouts in gatling.config.
Welcome to Performance Testing Using Gatling!
In this course, we will first lay the foundation by going through Scala concepts so that you understand Gatling's scripts better.
Then we will dig deep into the concepts of Gatling like session management, feeders, checks, response handling, advanced level injection profiles, and more.
We will then move onto Gatling's support for protocols like SSE & WebSocket.
Gatling is getting popular as it fits well with continuous integration platforms. We do not want you to miss out on that, and hence a complete section is dedicated to the integration of Gatling with Jenkins.
While you may think you are done with the advanced concepts, we believe that your journey has just begun. While we would have already given lots of hands-on activities, we present you with the development of a complete performance framework for Gatling.
Looking forward to having you on board with us.
Regards,
Bushra & Anuradha