The requested class('RecordedSimulationNewest') cannot be found in the classpat h or does not extends Simulation.

Hi,

I am new to Gatling. I am able to record and generate reports for the default application provided in the documentations.

Now, I have recorded a scenario using recorder.bat and the Recorded Simulation file is present in gatling home/user-files/simulations.
Name of the file = RecordedSimulationNewest

I have not imported any package in the class.

On double clicking the gatling.bat file; I am unable to find RecordedSimulationNewest option in the screen.

And while executing gatling.bat from command line using following command line options:-
gatling.bat -sf -s RecordedSimulationNewest

I am getting below error:-

RecordedSimulation is already defined as class Record
edSimulation
13:18:19.540 [ERROR] i.g.c.ZincCompiler$ - class RecordedSimulation extends Simu
lation {
13:18:19.540 [ERROR] i.g.c.ZincCompiler$ - ^
13:18:19.555 [ERROR] i.g.c.ZincCompiler$ - one error found
The requested class(‘RecordedSimulationNewest’) can not be found in the classpath or does not extends Simulation.

When checked, RecordedSimulationNewest class file is not present in gatling_home\target\test-classes folder.

Request you to kindly help me here as I am new to gatling.
Please let me know if I am going wrong somewhere.

Thanks,
Anuja

You’ve probably renamed the file (into RecordedSimulationNewest) but not the class itself inside the file, that’s still RecordedSimulation, hence the duplicate.
In Scala, file names and class names are not related.

Hi Stephane,

Thanks for your reply.
I checked in my RecordedSimulationNewest scala file. Class name is also RecordedSimulationNewest

A small snippet of the class:-

import scala.concurrent.duration._

import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._

class RecordedSimulationNewest extends Simulation {

val httpProtocol = http
.baseURL(“http://www.google-analytics.com”)
.proxy(Proxy(“proxy.abcd.com”, 8080).httpsPort(8080)
.credentials(“uname”,“pwd”))
.inferHtmlResources()
.acceptHeader("/")
.acceptEncodingHeader(“gzip, deflate, sdch”)
.acceptLanguageHeader(“en-US,en;q=0.8”)
.userAgentHeader(“Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36”)

Request you to kindly suggest the solution.

Thanks,
Anuja

Can you try ‘FINDSTR /S “RecorderedSimulation” *.scala’ on the Gatling directory please?

Hi,

Gatling home directory = D:\gatling-charts-highcharts-bundle-2.1.4-bundle

In cmd, I am enetring the command as:-

D:\gatling-charts-highcharts-bundle-2.1.4-bundle>FINDSTR /S “RecordedSimulation”*.scala

However no results are displayed.
Please help.

Thanks,
Anuja

Ok. Can you zip up your user-files directory and send the compressed file to me privately please?

Hii,

Was caught up with some work yesterday… Hence could not check.
However, I have checked now and as advised, there were two RecordedSimulation class. After renaming one, I am able to proceed now.

Thanks!!!
Anuja