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.

Testrunner

ClaritasClaritas Members
edited January 2012 in Sahi - Open Source
****
* OS Name: Windows 7
* Browser Name: Chrome 16
* Sahi Build: V3.5
****

Hello!
I wrote 22 tests, so I decided to create my first suite file.
The test.suite was look like:
First.sah
Second.sah
ThirdTest.sah
// etc...

After that I executed start_sahi.bat and the testrunner.bat with the following parameters:
testrunner test.suite http://www.example.hu chrome

It finished so early, so I added
_debugToFile(_scriptName() + ": start", "logs.txt");
to the beginning of the files to be sure about that every tests are executed.
The result was that it only runs 10 files from 22.
1. What should I do if I want to run all the tests?
I modified testrunner to SINGLE_SESSION=true, but it doesn't get better.

The other strange thing was I got FAILURE, which I've never caught at the GUI, so I added custom onScriptFailure(), onScriptError() and onScriptEnd().
For example:
function onScriptFailure()
{
    _debugToFile(_scriptName() + ": failure", "logs.txt");
}

I've read the documentation about it, but 2 things aren't clear.
2. What should I do if I want logging why my test failed next to its name? (f.e.: Is there $error?)
3. What is different exactly between failure (only assert?) and error?

Comments

  • Hi Claritas,

    First of all, there shouldnt be any issue running 22 scripts from the suite file.

    You dont have to change SINGLE_SESSION=true.

    Could you please click on Logs link and check which script is not executed? Try to run that particular script from the controller and check if it works fine.

    Also, could you please check if you are getting any error on Sahi console? If so please post it here.

    Also, kindly check if you are facing this issue with all other browsers.

    Could you please check this link : http://sahi.co.in/w/sahi-call-back-functions

    Regards
    Sumitra
  • ClaritasClaritas Members
    edited January 2012
    Hello Sumitra,
    I recongised that it even fails at the first two tests, so I only played with them.
    I created a new suite file: try.suite
    Fooldal.sah
    Kereses.sah
    

    [h]Single tests[/h]
    First I opened my Chrome, and I got these results for Fooldal.sah and Kereses.sah:
    1. Chrome: Sahi Controller
    Test    Total Steps    Failures    Errors    Success Rate    Time Taken (ms)
    Fooldal.sah    36    0    0    100%    35865
    Kereses.sah    73    0    0    100%    94314
    
    The only strange thing was the "Script error. (:)".
    In the logs it wrote "No trace available", but it showed Success at the end.

    2. Chrome: Testrunner
    testrunner Fooldal.sah http://127.0.0.1:1234 chrome: SUCCESS
    testrunner Kereses.sah http://127.0.0.1:1234 chrome: SUCCESS
    
    Everything worked fine.

    After that I tried them with Firefox (9.0.1).
    3. Firefox: Sahi Controller
    Test    Total Steps    Failures    Errors    Success Rate    Time Taken (ms)
    Fooldal.sah    36    0    0    100%    35140
    Kereses.sah    73    0    0    100%    39377
    

    4. Firefox: Testrunner
    testrunner Fooldal.sah http://127.0.0.1:1234 firefox: SUCCESS
    testrunner Kereses.sah http://127.0.0.1:1234 firefox: SUCCESS
    
    Everything was the same like in Chrome. So if I tried them as single tests everything was OK.

    [h]Suite files[/h]
    testrunner try.suite http://127.0.0.1:1234 chrome: FAILURE
    testrunner try.suite http://127.0.0.1:1234 firefox: FAILURE
    
    I could experience that it was succesfully with Kereses.sah, but it skipped the Fooldal.sah.
    In the console of start_sahi I could only read that it kills Fooldal.sah.

    Best wishes,
    Claritas
  • Hi Claritas,

    Could you please post the script of Fooldal.sah here?

    Also, check if you are getting any error in Logs? If so then please post it here.

    Regards
    Sumitra
  • Dear Sumitra,
    Here is the source of Fooldal.sah: http://pastebin.com/xpCAqkTA

    I hope it helps.
  • This is the simplest test: doesn't contain login or cookies etc ...
    That's why I really don't know what is happening with it next to other testcases in a suite file. :S
  • Hi Claritas,

    I could reproduce the same. I m working on it, will let you know once i find the solution.

    Also, i see that path to the log.txt should be given fully.

    Regards
    Sumitra
  • Dear Sumitra,
    Thanks a lot, I'm waiting for the solution. :)

    Good Luck!
Sign In or Register to comment.