URL encoding

after running my script, I noticed that I am getting a 404 error message in my log. I think it has to do with URL encoding.
The URL I am trying to use redirects me to a page that has a “#” in the URL like so https://server.com/userportal/#/mileage/period/current

in the debug log I noticed that its encoding the “#” and changing it to “23”


Any ideas how I can resolve this issue?

Which version of Gatling do you use? Do you use follow redirect?
I would have expected the fragment (what comes after the #) to be ignored.

I am using gatling-charts-highcharts-1.5.0

As for your other question “Do you use follow redirect”, I don’t think I do. Actually, I am not sure. How do I check?

I can’t reproduce.
I checked that a Location header https://server.com/userportal/#/mileage/period/current is indeed redirected to /userportal and that the fragment is not being sent to the server.

Could you provide more details, please? How is the redirect being done in your application? HTTP redirect?

yes, its HTTPredirect

And you say that your server returns a 30X with a Location header whose value is https://server.com/userportal/#/mileage/period/current, and that Gatling redirects to https://server.com/userportal/%23/mileage, right?


Then I really don’t understand and can’t reproduce.

I just built a test case and here’s what I get:


HTTP/1.1 303 See Other
Location: http://server.com/userportal/#/mileage/period/current
Content-Length: 0


GET /userportal/ HTTP/1.1
Host: server.com
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
DNT: 1
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip
Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0

As you can see, and as expected, Gatling doesn’t send the fragment part.

Could you try a proxy tool such as Charles, please?

Proxy Settings to check/enable the proxy ports, then add .proxy(“localhost”, 8888) to your httpConf in your Gatling simulation

see https://github.com/excilys/gatling/wiki/HTTP#wiki-proxy

Hi Mr. Stephane,

After running my script, log returned several requested resources with 404 response status.
I am using Gatling 2.1.7 and enabled Follow Redirects. I think what is expected is that 3XX status should be returned when requests are redirected.
I am confused over the 404 status while resources are actually accessible or “can be found”. Can this be a problem in the connection, the redirection process, or the application itself?
Please help.

Here’s a segment of the returned log:

Hi Julian,

You have to realize that we cannot help you unless you provide a reproducer, ie a Gatling simulation that we can run so we can investigate. Any simulation sample that can’t be run because you anonymized the urls is pretty useless.

If your application is private and you can’t share, I’m afraid you’re on your own. Then, you should probably get some help from your seniors.

We can help on private applications, but only our customers who purchased a support offer.