The default encoding is UTF-8,my response’s encoding is GBK。
when I recoding with GBK the response’s was unrecognizable characters .
when I recoding with UTF-8 the response’s was normally and when running gatling simulation I print the response that saved in session it’s also to be unrecognizable characters…
That must be something wrong with my config.but I don’t know where is it .Can help me finger it out ? Thx.
Did you trying changing the encoding in gatling.conf?
在 2014年7月8日星期二UTC+8下午1时54分30秒,Stéphane Landelle写道:
<?xml version="1.0" encoding="GBK"?>net.sf.json.JSONArray1net.sf.json.JSONObjecttext<tr align='left'><td><a style='color:#0000ff' href='view.jsp?bookId=2'>銆婃?鑳芥祴璇曡繘闃舵寚鍗椻?鈥擫oadRunner 11瀹炴垬銆?浣滆?:闄堥渷</a>    <span style='color:red;'>娌℃湁搴撳瓨</span><div>銆婃?鑳芥祴璇曡繘闃舵寚鍗?LoadRunner 11瀹炴垬銆嬫槸涓?湰鍩轰簬HP LoadRunner 11宸ュ叿鐨勬寚瀵肩敤涔︼紝浠庢?鑳芥祴璇曞師鐞嗗埌宸ュ叿浣跨敤鍐嶅埌椤圭洰瀹炴柦锛屽叏闈粙缁嶄簡鎬ц兘娴嬭瘯鐨勫悇涓柟闈紝鍏跺唴瀹瑰熀鏈富绾胯鏄庡涓?#60;B>...</B></div></td></tr>value1Did you trying changing the encoding in gatling.conf?
The default encoding is UTF-8,my response’s encoding is GBK。
when I recoding with GBK the response’s was unrecognizable characters .
when I recoding with UTF-8 the response’s was normally and when running gatling simulation I print the response that saved in session it’s also to be unrecognizable characters…
That must be something wrong with my config.but I don’t know where is it .Can help me finger it out ? Thx.–
You received this message because you are subscribed to the Google Groups “Gatling User Group” group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.Yes,I did that. I changed gatling.conf #encoding = “GBK” and changed recorder.conf #encoding=“GBK” and chose the recoding encoding “GBK” .When recoding my response string also unrecognizable characters . The follow is my response string:
I had removed “#” character and set encoding = “UTF-8” . but the output to console also be unrecognizable characters.
.exec(http(“request_8”)
.post("""/library/bfapp?sid=LibraryMgr""")
.headers(headers_4)
.body(RawFileBody(“RecordedSimulationGBK_request_8.txt”))
.check(
xpath("//map").saveAs(“new”)
)
)
.exec(session => {
println("******------------->"+session(“new”).as[String])
session
})
println string is:
******------------->net.sf.json.JSONObjecttext閵嗗﹥锟介懗鑺ョゴ鐠囨洝绻橀梼鑸靛瘹閸楁せ
锟介垾鎿玱adRunner 11鐎圭偞鍨妴锟芥担婊嗭拷:闂勫牓娓?/a>    濞屸剝婀佹惔鎾崇摠
I solved the problem with saveAs() and then get value from Session.
.body(RawFileBody(“RecordedSimulationOCX_request_42.txt”))
.check(bodyString.saveAs(“new”))
)
.exec(session=>{
println(session(“new”).as[String]) //println out value is normal.
session
})
thanks for the response.
So it turns out that Saxon doesn’t support GBK out of the box.
I’ve opened an issue: https://github.com/excilys/gatling/issues/2012
Thanks for reporting.
Done: https://github.com/excilys/gatling/issues/2012
So now Gatling falls back to JDK XPath (less efficient) if Saxon doesn’t support configured encoding.