Skip to content

Generating realistic test data or simulating load with authentic, dynamic data using the Gatling framework and JavaFaker

Notifications You must be signed in to change notification settings

sbittla/gatling-javafaker-maven

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gatling-javafaker-maven framework

This is a simple framework for Gatling Frontline using JavaFaker for data generation, implemented in Scala with Maven.

Setup

  1. Clone the repository.
  2. Navigate to the project directory.
  3. Open the project in IntelliJ IDEA.
  4. Set environment variables in IntelliJ:
    • Go to Run -> Edit Configurations...
    • Select your simulation configuration.
    • Add BASE_URL environment variable with your base URL.
  5. Run the simulations using the Maven lifecycle or directly from IntelliJ.

Folder Structure

gatling-javafaker-maven/
├── src/
│   ├── main/
│   │   ├── scala/
│   │   │   ├── services/
│   │   │   │   └── UserService.scala
│   │   │   └── util/
│   │   │       └── DataGenerator.scala
│   ├── test/
│   │   ├── scala/
│   │   │   └── simulation/
│   │   │       └── UserSimulation.scala
│   │   ├── helpers/
│   │   │   └── Engine.scala
│   ├── resources/
│   │   ├── config/
│   │   │   └── UserConfig.conf
│   │   ├── images/
│   │   │   └── IntelliJ.png
│   │   │
├── pom.xml
└── README.md
  • src/main/scala: Contains the main code (config, service, util).
  • src/test/scala: Contains the Gatling simulations.

Dependencies

  • Gatling
  • JavaFaker

Example

To run the UserSimulation, use the following command:

mvn gatling:test

Example

To run the UserSimulation, use the following command:

IntelliJ

To configure run time settings in IntelliJ