18 January 2026:


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

josue.boixjosue.boix Members
edited November -1 in Sahi - Open Source
I have the same problem with the last version of Sahi.

Could someone help me? It is driving me crazy.

Comments

  • Any ideas? I am still stuck.
  • Hello again,
    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?
  • I still do not know what is happening here, and nobody seems to be interested or knowing the problem.
  • This thread has 1,384 views. It seems there is enough interest in this thread, but unfortunately I can't fix your problem. What I can say is, that the code you posted is injected by the Sahi proxy, which is pretty obvious.

    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 views are mostly for the issue with version 2, that has been resolved, not for mine. My problem is the same but it occurs with the new version of the Sahi proxy, as I posted in a previous message.

    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.
  • narayannarayan Administrators
    Hi Josue.boix,

    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
  • Hello 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é
  • Hi 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
  • The pattern I am using is .*testqa.* because the webpage is inside a private intranet, which URL is http://testqa.oami.europa.eu/eSearch/

    Regards,

    Josué
  • I tried changing the pattern to http://testqa.oami.europa.eu/copla/conf/all. I found it using Firebug and I noticed that it is the URL where all the elements are loaded, so I added it to exclude_inject.txt and now it works fine. The page is loaded correctly and I can use the objects with the controller and record scripts.

    Thank you so much for your help.

    Best regards,

    Josué
Sign In or Register to comment.