Simulation with a mix of standard auth and cert auth

I have a simulation where i have a mix of scenarios, some of which are users logging into the system and some where an api is being hit using a certificate.

I would like to have a mix of both in my simulation, however, the gatling.conf file specifies a single keystore/truststore that gets loaded prior to the simulation being run.

This causes my standard auth scenarios to error out. Is there a way to specify the connection type on the session without using the global gatling.conf file and is there an example of how to do this? Is this done in the setup of the simulation, or within the scenario itself?

Ideally, I would potentially also like to authenticate with multiple certificates, one for each different scenario, is this possible? Here is the setup to my simulation file. First 3 are being fed usernames and passwords through a feeder and the last is a certificate user scenario.

class LoadSimulation extends Simulation {

  def httpProtocol: HttpProtocolBuilder = http
    .baseUrl(SimulationUtils.BASE_URL)
    .headers(SimulationUtils.DEFAULT_HEADERS)
    .inferHtmlResources(WhiteList(SimulationUtils.BASE_URL + "/docp/.*")) //automatically load injected javascript that comes from HTML
    .disableCaching

  def httpProtocolLocal: HttpProtocolBuilder = http
    .baseUrl(SimulationUtils.BASE_URL_LOCAL)
    .header("Content-Type", "application/json")
    .disableCaching
    .disableUrlEncoding

  setUp(
    /**
     * 1. Login
     * 2. Search for an invoice
     * 3. Click on random invoice in the row
     * 4. Repeat steps 2 and 3, 10 times
     */
    BuyerInvoiceSearchScenario.ScenarioBuilder.inject(
      heavisideUsers(50) during (60 seconds)
    ).protocols(httpProtocol),

    /**
     * 1. Login
     * 2. Search for an PO
     * 3. Click on random PO in the row
     * 4. Repeat steps 2 and 3, 2 times
     */
    BuyerPurchaseOrderSearchScenario.ScenarioBuilder.inject(
      heavisideUsers(50) during (60 seconds)
    ).protocols(httpProtocol),

    /**
     * 1. Go to the welcome app.
     * 2. Request invoices using access token
     * 3. Request invoice history
     * 4. Repeat steps 2 and 3, 10 times
     */
    InvoiceWelcomeAppScenario.ScenarioBuilder.inject(
      heavisideUsers(100) during (60 seconds)
    ).protocols(
      httpProtocol
        .header("x-p2p-client", "welcome")
    )
  )
    /** 1. Hit api with cert user credentials to retrieve invoices */
    CertUserScenario.ScenarioBuilder.inject(heavisideUsers(100) during (10 seconds)
  ).protocols(httpProtocolLocal)
}

No, it’s not possible.
First time we see this use case :stuck_out_tongue:

Willing to contribute?

Just to clarify, which part isn’t possible? Running parallel simulations using certificate users and without? Seems like you would want to load test outside integrations and regular users as part of the same load test, but perhaps I am not being clear or I am missing something. If this is not a use case you have encountered I may be willing to contribute in my spare time if I can understand the scope of this.