Gatling upload file with jsf

I recorded upload file with jsf, and gatling create such kind of code:

val scn = scenario(“RecordedSimulation”)
.exec(http(“request_0”)
.get("""/converis/rfRes/fileUploadProgress.xhtml?ln=org.richfaces&rf_fu_uid_alt=0.7059967583045363""")
.headers(headers_0)
.resources(http(“request_1”)
.post(uri1 + “”"/mypages/edit/Publication/247307/default?rf_fu_uid=0.7059967583045363""")
.headers(headers_1)
.body(RawFileBody(“RecordedSimulation_request_0001.txt”)),
http(“request_2”)
.get(uri1 + “”"/rfRes/fileUploadProgress.xhtml?ln=org.richfaces&rf_fu_uid_alt=0.7059967583045363""")
.headers(headers_0),
http(“request_3”)
.get(uri1 + “”"/intern/images/icons/document/icon-ms-excel.gif""")
.headers(headers_3)
.check(status.is(304))))

But when I try to use this code in my script, it doesn’t upload file

JSF uses a hidden ViewStateId token and generates dynamic UUID for components where you didn’t set them explicitly.
You can’t replay a raw script recorded on a JSF application, you have to parameterize it a capture the appropriate tokens in the responses.

HI, i have view state extractor and it works well.

And about this uid, how can I generate him and tell to server about it?

Those component ids are generated by JSF server-side, when the developers didn’t force one.
You’d have to capture them in the response bodies, typically with a regex or a css selector.