how to share attributes between files

Hi,
I have write big simulation with session parameters(.formParam(“javax.faces.ViewState”, “${JSFViewState}”))), all post requests must have this param. After having exception “code is too large” I separate them in 2 files. When I try to run it says “No attribute named ‘JSFViewState’ is defined”. Any ideas? how to share attributes between files.

Arman.

Hi There,

I just faced this problem myself. I assume you recorded the simulation using Gatling Recorder. If so, it takes care of forming the request bodies automatically in the files for some requests and for others as formParam(s). In case you haven’t, I strongly recommend you to rerecord your website using the recorder.

For handling viewstates, you can refer here which turned out pretty good for me. The trick is to ElFileBody rather than RawFileBody for passing viewstate and other dynamic values. Don’t mix formParam & RawFileBody because that didn’t work for me in 2.2.0

-Mahesh

Hi Mahesh,

I am using recorder. “viewstates” is one of my parameters that shares between requests, my problem is to share session attributes, because I register(saveAs) in one file and use same attributes in other file. I separate my simulation into 3 files because it about 4500 lines and JVM says “code is too large”.

Regards,
Arman

Hi There,

I’m not quite sure how to pass values between simulations in various files, maybe using CSV feeders? You can give that a shot.

But “code is too large” can be avoided by rewriting your simulation to store all the form parameters in request body files rather than in the code.

-Mahesh

Hi Mahesh,

Thank you for quick response!

I think using feeders not a case for me, because in my case:

  1. one user login to the system
  2. fill the big data entry form
  3. log out
    then
  4. another user log in to the system
  5. find the for doing search(need some data from 2 step)
  6. edit data entry
  7. log out

I use work around by putting all simulation in one file and replacing all form parameters by one symbols (ex. .formParam(“projectDonorID”,“13”) change to .formParam("${pdID}",“13”)) but doing this for 4500 line is too complicated.
The best way to find solution to use recorded file by recorder.

Regards,
Arman

Yes. Based on what I went through in the last one week, it’s always better to use recorder especially for websites, especially for newbies :slight_smile:

-Mahesh

Hi There,

Any Ideas?

Regards,
Arman

Instead of splitting it into two files, I’d recommend storing the request bodies in files (which is “almost” the default way recorder does) and use ElFileBody to replace viewstate values dynamically.

-Mahesh

Dear Mahesh,

This not help in my case, I don’t save bodies.

Regards,
Arman

Is there any reason why you can’t save request bodies? Because I can’t think of/ know of any other way.

Dear Mahesh,

When I try to record simulation with bodies, it records many rows and my problem is still not solved because in all request I have:

.formParam("javax.faces.partial
.formParam(“javax.faces.source”
.formParam("javax.faces.partial
.formParam("javax.faces.partial
.formParam("portfolioForm:pertf
.formParam("portfolioForm:selec
.formParam("portfolioForm:calen
.formParam("portfolioForm:court
.formParam("portfolioForm:court
.formParam("portfolioForm:court
.formParam("portfolioForm:court
.formParam("portfolioForm:court
.formParam("portfolioForm:court
.formParam("portfolioForm:caseF
.formParam("portfolioForm:caseF
.formParam("portfolioForm:caseF
.formParam("portfolioForm:caseN
.formParam("portfolioForm:caseO
.formParam("portfolioForm:caseO
.formParam("portfolioForm:caseH
.formParam("portfolioForm:caseH
.formParam("portfolioForm:caseR
.formParam("portfolioForm:caseR
.formParam("portfolioForm:lastU
.formParam("portfolioForm:lastU
.formParam("portfolioForm:caseI
.formParam("portfolioForm:caseI
.formParam("portfolioForm:qrCod
.formParam("portfolioForm:qrCod
.formParam("javax.faces.ViewSta
.formParam("javax.faces.ViewSta

Regards,
Arman