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 hanging on blank page

edited November -1 in Sahi - Open Source
I am a twist user. On our firefox build (ff 3.6.9 on linux) the tests hang. When you login to the build machine there is a blank page in firefox, but if you view source everything appears to be loaded correctly (no view source does not appear to make another request), html is valid and all that jazz.

Because nothing is wrong with the HTML, my guess is that this is something with the sahi proxy or how it is interacting with firefox.

I cannot reproduce this on my local machine with firefox. Any ideas or suggestions would be appreciated.

Comments

  • narayannarayan Administrators
    Hi Joshua,

    Open sahi/htdocs/spr/concat.js and search for
    url = ""+url;
    var opened = this.openOld(method, url, async, username, password);
    
    and replace it with
    var opened = this.openOld.apply(this, arguments);
    url = ""+url;
    
    Restart Sahi, clear browser and check if it works.

    Regards,
    Narayan
  • Thanks narayan,

    I've applied the change. I'll let you know (probably later today or next week) if it works. The problem is intermittent, about one in 3 builds, so it will take some time to know if this fixes anything. I'm curious why you suggested this particular change. Could you explain it a little more for me?
  • narayannarayan Administrators
    We found some errors in AJAX handling which got fixed when we switched to using function.apply(this, args) instead of a this.fn(args) call. We could not really see why they should be different, but it fixed some significant errors on Firefox. (The version which ships with Twist is a little older. The newer versions of Sahi already have the fix suggested above.)
  • Thanks Narayan, we applied the changes and our firefox build does seem more reliable, but the problem hasn't been completely fixed. The build still hangs in exactly the same way only less frequently now. Any other suggestions would be appreciated and thanks for the help thus far.
  • schuschu Members
    Actually, the problem is still happening. We did notice the Firefox error console contains two errors, one says "/usr/lib/update.locale" file does not exist, and two says "nsBlockListService.js" gave an error NS_ERROR_NOT_AVAILABLE.

    We fixed the "update.locale" one by touching the file. The second one is a bit opaque, but I suspect it has to do with the Firefox profile's Security->"Block reported attach sites" is checked by default.

    Also, we noticed that every so often, during a test run, we'd see errors like such:
    java.io.EOFException
    at java.io.DataInputStream.readInt(DataInputStream.java:375)
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:628)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)
    at java.security.KeyStore.load(KeyStore.java:1185)
    I am suspecting it's Firefox making some https call to mozilla servers to get updates (either add-ons, or block list updates, etc.).

    Is there a way to detect, or completely disable all Firefox unnecessary calls?
  • edited March 2011
    Hey Narayan - just in case you are wondering, Josh, Stephen and myself are all on the same team and not different people all noticing the same problem :)

    I did some more investigation today and even after fixing the JS errors that Stephen reports above, the hanging issue continues.

    What you might find interesting is that when we notice the "hang" - it seems like the entire page is downloaded. i.e. the html content of the page that we expect to see is obtained. However, the browser window stays blank and does not display the HTML it receives. Hence the sahi driver waits for the page load to complete and never proceeds to the next-step of the scenario. This is what we are referring to as the "hang".

    My three suspicions at this point are

    a) There is probably some race condition between the window.load/dom:loaded prototype event and how Sahi detects page load completion. Is this possible?

    b) If the HTML is received but not displayed on the browser - could it be some sort of odd interactions on the sahi proxy which cause the browser possibly think it is waiting for more content? The browser is configured to use the proxy at localhost:9999.

    c) In our case, there are Ajax calls that get fired after the page loads. These Ajax calls use absolute URLs and the complete hostname of the machine rather than a relative URL. Will this sort of request actually go through the Sahi proxy as configured? If not - could this cause Sahi to not be able to correctly count/wait for the page to get loaded (because there is content that gets loaded after the page loads - but these secondary loads do not go via the Sahi proxy)?

    Please let me know what your thoughts are! Thank you!
  • narayannarayan Administrators
    Hi Badri,

    Sahi is not affected or dependent on points a and c.
    Point b could be possible. In cases when we have seen this kind of behaviour, it has been because of some other Firefox plugin, or an anti-virus software. Do you have any plugins on the profiles that the tests run on? Any anti-virus on that system?

    Meanwhile, we are also investigating further on this.

    Thanks,
    Narayan
  • Narayan

    I do believe we have an anti-virus software running on those agents. Anything specific I should look for? This is a CentOS VM - so do you have details of what AV agents could cause this?

    Also - is there something else we could provide you - such as the HTML content of the (different) pages that the hang occours at which would help? Any Sahi logs?

    Thank you for your response!
  • narayannarayan Administrators
    Hi Badri,

    You could try disabling the AV and check if things work properly. I have had problems on Windows systems, so I am not sure about CentOS.

    If the error is frequently seen, we can trouble shoot this via a desktop sharing session.
    Is there any pattern in the failures?

    We could also try turning on HTTP traffic logging to see if there is a pattern. For this, open sahi/config/sahi.properties and set

    debug.traffic.log.unmodified=true
    debug.traffic.log.modified=true

    Restart Sahi. All traffic will be written to logs, so we can look at the headers and content later. Note that this is only useful if we can pinpoint which request caused the hang. So you will have to play back sequentially and constantly monitor that system.

    Regards,
    Narayan
Sign In or Register to comment.