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.

Sahi scripts do not run on some machines

hari19hari19 Members
edited November -1 in Sahi - Open Source
Hi,

I had recorded my scripts on a Windows XP machine and they run fine on that machine. ( browser used : IE 7 )

If I run the same script on a Windows 2003 machine the tests do not run ( I tried with IE6 and then IE7 also )

The html result page has the following error :
JSERROR Script did not start within 5 minutes  at Aug 24, 2009 7:51:59 PM

The browser just hangs with the following URL in the Address Bar.
http://sahi.example.com/_s_/dyn/Player_auto?file=E%3A%5Cwork%5Cscripts%5Cbug.sah&startUrl=http%3A%2F%2Fsomesite.com%3A8180%2F&sahisid=sahi_1251123401078sahix170x

This same issue was faced by my team member who was running the same test on IE 6 on Windows XP.

Any idea what could be causing this issue ?

thanks,
Hari

Comments

  • narayannarayan Administrators
    Looks like the proxy is not set on IE on that machine. Note that toggle_IE_proxy.exe only toggles the proxy settings for IE. You need to have set it to localhost:9999 at least once on the given machine.
  • The proxy has been set.
    While IE appeared hung , I checked in Tools > Internet Options > Connections > LAN Settings.
    It was set to localhost:9999

    btw I do not use toggle_IE_proxy.exe.
    I created two reg files, one which sets and enables the proxy in IE by changing the settings directly in the registry and another which changes the settings to no proxy.
    This was to achieve no-manual intervention to run the tests.
  • narayannarayan Administrators
    Can you try to force a refresh on the page when it appears hung? Do you see any errors on Sahi console?

    Could you also try setting the proxy before the tests manually, removing the invocation of registry based toggling and see what happens?

    Looks like http://sahi.example.com/_s_/dyn/Player_auto never reaches the proxy.
  • I don't see any errors in the Sahi console.
    sahi.log seems to have a lot of repeating requests.

    I will be able to try refreshing only tomorrow.

    I will let you know the results tomorrow morning.
  • hari19hari19 Members
    edited August 2009
    I refreshed the page and I do not see any change in the browser.
    There is no error in the Sahi console.

    I set the proxy manually in IE and removed the lines in the ant script that do the same.
    There is no difference in behaviour.

    The text seen in the Sahi console is
         [java] #### Running Script: E:\work\scripts\bug.sah
         [java] "C:\Program Files\Internet Explorer\\iexplore.exe"  "http://sahi.example.com/_s_/dyn/Player_auto?file=E%3A%5Cwork%5Cscripts%5Cbug.sah&startUrl=http%3A%2F%2Fsomesite.com%3A8180%2F&sahisid=sahi_1251209032953sahix1234x"
         [java] PID: [1588]
    

    Please also note that the exact same code ( without any changes ) worked fine in a different Windows XP machine.
  • hari19 wrote:
    I created two reg files, one which sets and enables the proxy in IE by changing the settings directly in the registry and another which changes the settings to no proxy.
    This was to achieve no-manual intervention to run the tests.

    Good idea! Could you please post the details so I can use this approach too?

    Thanks in advance.
  • Pasting the content of the registry files here :
    F:\reg>type proxy_enable.reg
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
    "ProxyOverride"="*.local"
    "ProxyEnable"=dword:00000001
    "ProxyServer"="localhost:9999"
    
    F:\reg>type proxy_disable.reg
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
    "ProxyOverride"="*.local"
    "ProxyEnable"=dword:00000000
    "ProxyServer"=":"
    

    I create these reg files on the fly during each test run using the following ant snippet :
        <property name="disable-proxy-reg-file" value="${sahi.basedir}/dependencies/reg/proxy_disable.reg" />
        <property name="enable-proxy-reg-file" value="${sahi.basedir}/dependencies/reg/proxy_enable.reg" />
    
    
        <target name="create-ie-proxy-reg-files" description="Creates the Registry files used to enable proxy in IE">
            <!-- Registry File for enabling Proxy -->
            <echo message="Windows Registry Editor Version 5.00${line.separator}" file="${enable-proxy-reg-file}" append="false" />
            <echo message="${line.separator}" file="${enable-proxy-reg-file}" append="true" />
            <echo message="[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]${line.separator}" file="${enable-proxy-reg-file}" append="true" />
            <echo message='"ProxyOverride"="*.local"${line.separator}' file="${enable-proxy-reg-file}" append="true" />
            <echo message='"ProxyEnable"=dword:00000001${line.separator}' file="${enable-proxy-reg-file}" append="true" />
            <echo message='"ProxyServer"="localhost:9999"${line.separator}' file="${enable-proxy-reg-file}" append="true" />
            
            <!-- Registry File for disabling Proxy -->
            <echo message="Windows Registry Editor Version 5.00${line.separator}" file="${disable-proxy-reg-file}" append="false" />
            <echo message="${line.separator}" file="${disable-proxy-reg-file}" append="true" />
            <echo message="[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]${line.separator}" file="${disable-proxy-reg-file}" append="true" />
            <echo message='"ProxyOverride"="*.local"${line.separator}' file="${disable-proxy-reg-file}" append="true" />
            <echo message='"ProxyEnable"=dword:00000000${line.separator}' file="${disable-proxy-reg-file}" append="true" />
            <echo message='"ProxyServer"=":"${line.separator}' file="${disable-proxy-reg-file}" append="true" />
        </target>
    
  • hari19 wrote:
    Pasting the content of the registry files here :
    F:\reg>type proxy_enable.reg
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
    etc.
    
    I eventually found out that if Sahi is running as a Windows service using the LocalSystem account (the default), modifying anything in HKEY_CURRENT_USER has no effect. To set up Windows proxying (and therefore IE proxying) in such a scenario, you instead need to modify the data in HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings, as per this answer on ServerFault.com:

    h t t p://serverfault.com/questions/34940/how-do-i-configure-proxy-settings-for-local-system/34943#34943

    Hope this helps anyone trying to run Sahi as a Windows service (e.g. from a CI server such as Hudson; surely I'm not the only person to try this...)
Sign In or Register to comment.