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.

Ant driven tests errors out with 20091023 build. Ran with 20090715.

hari19hari19 Members
edited November -1 in Sahi - Open Source
I was using the 20090715 build in my tests and I replaced it with the 20091023 build..
I'm seeing a few problems.

When starting Sahi I see the following error :
     [java] Sahi properties file = F:\sahi\config\sahi.properties
     [java] Sahi user properties file = F:\sahi\bin\config\userdata.properties
     [java] java.io.FileNotFoundException: F:\sahi\bin\config\userdata.properties (The system cannot find the path specified)
     [java]     at java.io.FileInputStream.open(Native Method)
     [java]     at java.io.FileInputStream.<init>(FileInputStream.java:106)
     [java]     at java.io.FileInputStream.<init>(FileInputStream.java:66)
     [java]     at net.sf.sahi.config.Configuration.loadProperties(Configuration.java:107)
     [java]     at net.sf.sahi.config.Configuration.init(Configuration.java:95)
     [java]     at net.sf.sahi.config.Configuration.init(Configuration.java:74)
     [java]     at net.sf.sahi.Proxy.main(Proxy.java:63)

Is this error a problem or will Sahi just use the global Sahi properties ?


Further when running the test cases I see the following errors and the tests do not run successfully.
     [java] #### Running Script: F:\scripts\TESTCASE.sah
     [java] "F:\Programs\WinXP\net\Firefox3\\firefox.exe" -no-remote -profile F:\files\browser\firefox\profile_temp "http://sahi.example.com/_s_/dyn/Player_auto?file=F%3A%5Cscripts%5CTESTCASE.sah&startUrl=http%3A%2F%2Fsomesite.com%3A8180%2F&sahisid=sahi_2ab475e605b7e0489f0885e05a7dc4656d6fsahixdd7f12450af920429f088850e632159526d0x"
     [java] PIDs: [6120]; 547 ms
     [java] net.sf.sahi.util.FileNotFoundRuntimeException: java.io.FileNotFoundException: F:\sahi\bin\config\download_contenttypes.txt (The system cannot find the path specified)
     [java]     at net.sf.sahi.util.Utils.readFile(Utils.java:150)
     [java]     at net.sf.sahi.util.Utils.readFile(Utils.java:137)
     [java]     at net.sf.sahi.util.Utils.readCachedFile(Utils.java:130)
     [java]     at net.sf.sahi.config.Configuration.getDownloadContentTypes(Configuration.java:405)
     [java]     at net.sf.sahi.RemoteRequestProcessor.isDownloadContentType(RemoteRequestProcessor.java:220)
     [java]     at net.sf.sahi.RemoteRequestProcessor.processHttp(RemoteRequestProcessor.java:127)
     [java]     at net.sf.sahi.RemoteRequestProcessor.processHttp(RemoteRequestProcessor.java:79)
     [java]     at net.sf.sahi.ProxyProcessor.processAsProxy(ProxyProcessor.java:120)
     [java]     at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:78)
     [java]     at java.lang.Thread.run(Thread.java:595)
     [java] Caused by: java.io.FileNotFoundException: F:\sahi\bin\config\download_contenttypes.txt (The system cannot find the path specified)
     [java]     at java.io.FileInputStream.open(Native Method)
     [java]     at java.io.FileInputStream.<init>(FileInputStream.java:106)
     [java]     at net.sf.sahi.util.Utils.readFile(Utils.java:147)
     [java]     ... 9 more
     [java] Killing F:\scripts\TESTCASE.sah
     [java] Kill: [6120]

What changes do I need to make to the my ant based tests work with 20091023 ?

Ant script is similar to the script as in :
http://sahi.co.in/w/Running+multiple+tests+in+batch+mode

thanks!

Comments

  • It looks like, it is not recognising the userdata file directory. Check whether <sahi home directory>/userdata/config directory exists or not and if it exists, then start sahi by running "start_sahi" batch file located at <sahi home directory>/userdata/bin directory

    Please try downloading sahi again and use it (If the above solution is not working).

    Let us know, if you still get any problems regarding this.
  • narayannarayan Administrators
    Hari,

    Adding to what Venkat says;

    With the newer releases, we have moved all the scripts, certs and some other user specific files into sahi/userdata directory. The concept is that you can move this userdata directory anywhere on the system and not necessarily keep them under sahi directory.

    Because of this change, you need to tell Sahi where to look for the userdata directory. This is already done in the batch files and shell scripts that come with Sahi.

    To fix your error, you have to do two things:

    1) If you are starting the proxy from ant, use the "start" target in the latest sahi/demo.xml which specifies the correct parameters to be passed. (This should mostly fix your issue.)

    2) Make sure that Sahi is able to get the correct path of the suite file.

    Have a look at http://sahi.co.in/forums/viewtopic.php?id=1222 to see details on the changes related to userdata.

    Regards,
    Narayan
  • Sorry for the delay in replying..

    Changing the Ant paramaters to start the sahi proxy as per demo.xml got this working..
    but facing another problem..
    Starting script
    Navigating to [object Object] at Dec 7, 2009 12:47:25 PM
    _log("Navigating to " + {"chars":null,"class":undefined,"bytes":[104,116,116,112,58,47,47,115,111,109,101,115,105,116,101,46,99,111,109,58,56,49,56,48,47,100,100,100]},"info"); at Dec 7, 2009 12:47:25 PM
    _navigateTo({"chars":null,"class":undefined,"bytes":[104,116,116,112,58,47,47,115,111,109,101,115,105,116,101,46,99,111,109,58,56,49,56,48,47,100,100,100]});
    TypeError: url.replace is not a function
    ([object Object])@http://somesite.com:8180/_s_/spr/concat.js:1234
    ()@http://somesite.com:8180/_s_/spr/concat.js:2465
    ()@http://somesite.com:8180/_s_/spr/concat.js:2465
    @http://somesite.com:8180/_s_/spr/concat.js:2307
    
    Click for browser script at Dec 7, 2009 12:47:36 PM
    Stopping script
    

    Snapshot below :
    http://img682.imageshack.us/i/sahi20091023error.jpg/
    

    The exact same script works with the 20090715 build that I was using previously.
  • narayannarayan Administrators
    Hi Hari,

    Can you tell us how the variable that is passed to _log and _navigateTo is initialized or assigned?
    Somehow the object does not seem to be recognized as a javascript string.

    Could you give us a small example script to reproduce this?

    Regards,
    Narayan
  • The value is initialized and the same script works with 20090715 build.

    [104,116,116,112,58,47,47,115,111,109,101,115,105,116,101,46,99,111,109,58,56,49,56,48,47,100,100,100]
    is the ascii code for [ h t t p : / / s o m e s i t e . c o m : 8 1 8 0 / d d d ]
    104 = h , 116 = t etc..
  • narayannarayan Administrators
    Hari,

    This bug is fixed in the lastest version of Sahi - 20091130. (https://sourceforge.net/projects/sahi/files/sahi-v3/2009-11-30/sahi_20091130.zip/download)
    Are you using that build? It has a few important bufixes over 20091022.

    Regards,
    Narayan
  • No.. I've been using the 20091023 build.
    Will try with 20091130 build and revert..
  • All the scripts work fine with the 20091130 build..

    Thanks!
This discussion has been closed.