18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
AJAX not working
I have the same problem with the last version of Sahi.
Could someone help me? It is driving me crazy.
Could someone help me? It is driving me crazy.
Comments
The only difference between the webpage loaded normally and the webpage executed under the Sahi proxy is the following code, included in the <head> section:
<!--SAHI_INJECT_START-->
<script>/*<![CDATA[*//*---->*/__sahiDebugStr__="";__sahiDebug__=function(s){__sahiDebugStr__+=(s+"\n");};/*--*//*]]>*/</script>
<script src="/_s_/dyn/SessionState_domainfix/domainfix.js"></script>
<script src='/_s_/spr/concat.js' id='_sahi_concat'></script>
<script src='http://sahi.example.com/_s_/dyn/SessionState/state.js'></script>
<script src='/_s_/spr/language_pack.js' id='langpack'></script>
<script>/*<![CDATA[*//*---->*/_sahi.createCookie('sahisid', _sahi.sid);_sahi.loadXPathScript()/*--*//*]]>*/</script>
<script>/*<![CDATA[*//*---->*/eval(_sahi.sendToServer("/_s_/dyn/Player_script/script.js"));/*--*//*]]>*/</script>
<script src='/_s_/spr/playback.js'></script>
<!--SAHI_INJECT_END-->
Any ideas?
Do you have the same problem as mentioned by boris? Did you tried Narayans patch? Please provide more information on whats going wrong.
Regards
Wormi
The patch offered for Narayan does not work, since the link is not operative. The problem is just the same and probably a similar solution would work.
Thanks for you help.
You need to add the pattern of the AJAX URL to exclude_inject.txt. More information is available in the
Trouble Shooting Sahi page: http://sahi.co.in/w/trouble-shooting-sahi
Regards,
Narayan
First of all, I would like to thank you very much for your answer, I've been stuck with this problem for a long time, It is very important to solve it and I was starting to be desperate.
I tried to add the pattern in the file exclude_inject.txt and now the controls are loaded in the webpage but I cannot use the controller to record the flow. Any ideas?
Thank you very much again, I really appreciate your help.
Best regards,
Josué
It appears that the pattern you added in the exclude_inject.txt prevents the headers to be included in the main page itself.
Can you let us know what is the pattern you used and what is the original URL you are using. The idea is to prevent including the headers in AJAX requests, but it must be present in the main pages.
Thanks,
Vivek
Regards,
Josué
Thank you so much for your help.
Best regards,
Josué