Illegal character in query ?

Hi All,

I just tried Gatling (for the first time) on a simple web page.

Gatling fails with the next:
10:22:52.043 [ERROR] i.g.h.a.HttpRequestAction - Action HttpRequestAction crashed, forwarding user to next one
java.net.URISyntaxException: Illegal character in query at index 55: http://xxxxxxx:8000/api/template/standardStep?id={97F1C283-AA1C-4734-BA91-5551715EFD47}

Not sure why Gatling returns with error message as index 55 is the “F” char (to my best guess). Feel free to correct me if wrong or direct me to the solution.

I’m using on gatling-charts-highcharts-2.0.0-M3a on win 7 (Oracle JDK 7)

Many Thx
GK

Aren’t the curly-brackets the issue?
Cheers
Nicolas

U are spot on!!!

I removed the curly-brackets and managed to progress.

Many Thanks,

Guy

Hi Nicolas,

Not sure if removing the curly bracket ended up nicely. I examined the output and it comes as 403 error for the above request.

Should I change the curly brackets with “123” and “125” (html codes)/else?

Many Thx,

Guy

Can I see how this is used in your scenario ?

Nicolas

Those curly braces have a meaning for your application. You mustn’t remove them: you must urlencode them. curly braces are illegal in a query string.
Check out this page: http://www.w3schools.com/tags/ref_urlencode.asp

There’s even an encoder that you can use there, you’ll see that {97F1C283-AA1C-4734-BA91-5551715EFD47} has to be encoded into:
%7B97F1C283-AA1C-4734-BA91-5551715EFD47%7D

Gatling doesn’t automatically encode the url, but it does so with the queryParams, so if you don’t want to encode yourself upstream like above, you can use:

get(“http://xxxxxxx:8000/api/template/standardStep”).queryParam(“id”, “{97F1C283-AA1C-4734-BA91-5551715EFD47}”)

Of course, this comes with a penalty as the urlencoding will happen for every request sent.

Many Thx Stephane and Nicolas.

I will try again and update.

Guy