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.

test suite unstable under linux?

descartedescarte Members
edited November -1 in Sahi - Open Source
hi,

i like sahi so far but it seems to be quite unstable under linux. i was using firefox and consistently faced errors every time i ran a test suite containing more than 1 test.

in my test suite, i have 2 tests like so

blogs1.sah blogs
blogs2.sah blogs

firefox opened 2 tabs. The first tab ran blogs1.sah but blogs2.sah opened up the url and never ran the test.

this is echoed from the command line. Any ideas or suggestions would be appreciated.
---
suiteName = /home/mybox/sahi/userdata/scripts/blogs.suite
browser = /home/mybox/Desktop/firefox/firefox
base = blogs
sahiHost = localhost
port = 9999
threads = 3
browserOption = -P sahi
browserProcessName = firefox
Added shutdown hook.
localhost:9999/_s_/dyn/Suite_start?suite=%2Fhome%2Fmybox%2Fsahi%2Fuserdata%2Fscripts%2Fblogs.suite&base=blogs&threads=3&sahisid=sahi_4fc219850500b040840906f0e18f5cb8834c&browser=%2Fhome%2Fmybox%2FDesktop%2Ffirefox%2Ffirefox&browserProcessName=firefox&browserOption=-P+sahi&html=%2Fhome%2Fmybox%2Fsahi%2Fuserdata%2Fscripts%2Fsuitelogs
Status:FAILURE

Comments

  • narayannarayan Administrators
    Hi Descarte.

    You seem to be using your own custom profile (browserOption = -P sahi)
    You need to let Sahi use one of its profiles instead. Use

    -profile $userDir/browser/ff/profiles/sahi$threadNo -no-remote

    instead of

    -P sahi

    in your shell script.

    Regards,
    Narayan
  • thanks for the reply.

    I am using firefox version 3.6.13. perhaps its incompatible with the version?

    The -profile option didnt work.

    also, when I added the "-no-remote" option, i got this error in the window

    "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system."

    Having ran out of ideas, I copied the pref.fs under userdir/browser/ff/profiles/sahi3 to my ff profile under ~/.mozilla/firefox but it didnt work as well.

    perhaps sahi is more well-tested under IE??
  • narayannarayan Administrators
    Hi Descarte,

    Could you please post your output again, with the new changes? (like you did in the first post?) We use firefox extensively, so firefox is not the problem.

    Regards,
    Narayan
  • Firefox should really be no problem.
    The first time you started the Sahi Proxy, the user profiles for FF are automaticly created and need no modification. Just use the browseroptions narayan stated, your starter should look like this (well with modified variables):
    java -cp $SAHI_HOME/lib/ant-sahi.jar net.sf.sahi.test.TestRunner $USER_DIR/scripts/$SUITEFILE "/usr/bin/firefox" $URL default localhost 9999 3 firefox "-profile $SAHI_HOME/userdata/browser/ff/profiles/sahi\$threadNo -no-remote"
  • thanks for the help so far...

    are you guys using linux to run firefox? The same result for me. The first test ran but the second never did.

    after i ran the command, again it spawned 2 new windows. then the second window has a message

    "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system."

    profile=/home/mybox/sahi/userdata/browser/ff/profiles/sahi3
    suiteName = /home/mybox/sahi/userdata/scripts/blogs.suite
    browser = /home/mybox/Desktop/firefox/firefox
    base = blogs
    sahiHost = localhost
    port = 9999
    threads = 3
    browserOption = -profile /home/mybox/sahi/userdata/browser/ff/profiles/sahi3 -no-remote
    browserProcessName = firefox
    Added shutdown hook.
    localhost:9999/_s/dyn/Suite_start?suite=%2Fhome%2Fmybox%2Fsahi%2Fuserdata%2Fscripts%2Fblogs.suite&base=%3A%2F%2Fblogs&threads=3&sahisid=sahi_2ee8c8ca0fdd90447d0ad0e04d61870f0002&browser=%2Fhome%2Fmybox%2FDesktop%2Ffirefox%2Ffirefox&browserProcessName=firefox&browserOption=-profile+%2Fhome%2Fmybox%2Fsahi%2Fuserdata%2Fbrowser%2Fff%2Fprofiles%2Fsahi3+-no-remote&html=%2Fhome%2Fmybox%2Fsahi%2Fuserdata%2Fscripts%2Fsuitelogs

    interesting enough, firefox doesnt even seem to have the -profile option

    i dont think the "-profile" option even work? I ran this in my command line and couldnt see the -profile option.

    mybox:~/Desktop/firefox$ ./firefox --help
    Usage: ./firefox-bin [ options ... ] URL
    where options include:

    X11 options
    --display=DISPLAY X display to use
    --sync Make X calls synchronous
    --no-xshm Don't use X shared memory extension
    --xim-preedit=STYLE
    --xim-status=STYLE
    --g-fatal-warnings Make all warnings fatal

    Firefox options
    -h or -help Print this message.
    -v or -version Print Firefox version.
    -P <profile> Start with <profile>.
    -migration Start with migration wizard.
    -ProfileManager Start with ProfileManager.
    -no-remote Open new instance, not a new window in running instance.
    -UILocale <locale> Start with <locale> resources as UI Locale.
    -safe-mode Disables extensions and themes for this session.
    -jsconsole Open the Error console.
    -browser Open a browser window.
    -private Enable private browsing mode.
    -setDefaultBrowser Set this app as the default browser.
  • narayannarayan Administrators
    Could you run

    /home/mybox/Desktop/firefox/firefox -profile /home/mybox/sahi/userdata/browser/ff/profiles/sahi3 -no-remote

    from the command line and check if it works?

    Also, check if there are sahi0 through sahi9 directories in /home/mybox/sahi/userdata/browser/ff/profiles/

    It may be that these directories were not created due to some file permission issue. If they are not there, give write permission to that directory and restart Sahi. Sahi will copy all the profiles as needed.

    Regards,
    Narayan
  • globalwormingglobalworming Moderators
    edited February 2011
    Dont worry, the -profile [Path] option works and is documented on the web ( firefoxWiki, Mozillla Support etc ).
    I think your problem are the browseroptions. Your running your tests with

    -profile /home/mybox/sahi/userdata/browser/ff/profiles/sahi3 -no-remote

    This will cause every script to start with the sahi3 profil! That's why you are getting this "already running" error.
    Change it to

    -profile /home/mybox/sahi/userdata/browser/ff/profiles/sahi\$threadNo -no-remote

    You can't replace $threadNo has. Sahi will automaticly fill in the right threadnumber, so your first script can run with sahi0-profile, the second with sahi1 and so on.
  • descartedescarte Members
    edited February 2011
    ok that looks like the reason.. tks.

    now i get 2 ff windows not 1 windows with 2 tabs. is that normal? then i got a bunch of errors like so

    >>>>>> Tests size = 2
    #### Running Script: /home/mybox/sahi/userdata/scripts/blogs1.sah
    #### Running Script: /home/mybox/sahi/userdata/scripts/blogs2.sah
    >>>> step=_sahi._assertExists(_sahi._link("Tech"));
    Window/Domain not found: popupNameFromStep=; derivedName=; windowName=; windowTitle=Twitter For Websites: Tweet Button; wasOpened=0; domain=twitter.com
    >>>> step=_sahi._assertExists(_sahi._link("Tech"));
    Window/Domain not found: popupNameFromStep=; derivedName=; windowName=; windowTitle=Twitter For Websites: Tweet Button; wasOpened=0; domain=twitter.com
    >>>> step=_sahi._assertExists(_sahi._link("Tech"));
    Window/Domain not found: popupNameFromStep=; derivedName=; windowName=; windowTitle=Twitter For Websites: Tweet Button; wasOpened=0; domain=twitter.com
    >>>> step=_sahi._assertExists(_sahi._link("Tech"));
    Window/Domain not found: popupNameFromStep=; derivedName=; windowName=; windowTitle=Twitter For Websites: Tweet Button; wasOpened=0; domain=twitter.com
    >>>> step=_sahi._assertExists(_sahi._link("Tech"));
  • narayannarayan Administrators
    Thanks globalworming for pitching in.

    Descarte, does the application include popup windows or other domains? The error message says that you are working on a different window or domain. Is that so?

    Regards,
    Narayan
  • ya right. i was on a different url. so the suite only works if you are testing everything in the same site.

    everything is ok now.... thanks everyone.

    one last question. The default test log seems to be in html which is fine. can i output my log to a text file and send the information in an email?
  • descarte wrote:
    ya right. i was on a different url. so the suite only works if you are testing everything in the same site.

    everything is ok now.... thanks everyone.

    one last question. The default test log seems to be in html which is fine. can i output my log to a text file and send the information in an email?

    Hi descarte,

    There is no direct option avilable for create log in Text file.

    But you can create on function with using "_write" function which allow you to write in .txt file. and Instead of using "_log" for logging you can use custom funtion for e.g. ExecutionLog("Your Text Here");

    I am using currently this kinda function in my automation project and then you can easily mail that "log.txt" file.
Sign In or Register to comment.