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.

Results tracking

jskariahjskariah Members
edited November -1 in Sahi - Open Source
Hi,
I am new to Sahi and have a couple of questions.

Question #1:
I tried a few functions and I would like to keep track of my results as I go through my execution. I noticed that Sahi prints a result in the end. Can I get that result in a variable during execution?

Question #2:
How do I handle alerts. Sahi doesn't seem to be detecting alerts.

Comments

  • escapeescape Members
    edited February 2008
    Hi

    just a suggestion :

    @question #1

    You can use _debugToErr , this will print everthing to the console window where the proxy is running unless redirected.

    _debugToErr("Hello"); --> Hello to console
    _debugToErr(_assertContainsText("", _submit("Login"))); --> true to Console

    or just use the RETURN of javascript

    function selfmade()
    {
    If ......
    RETURN ("OK");
    }

    call: _debugToErr( selfmade() );
  • This is a test
  • I am familiar with that. What I am looking for is a way to make sure every operation in a function is successful, so at the end of the function I can return a value and use that to print debug statements probably using _debugToFile.
  • narayannarayan Administrators
    I am not sure why you need this or whether this is what you need, but you could use _sahi.hadErrors() to see if there were any errors by the end of the test (not function) execution. This is what the controller uses to print 'SUCCESS' or 'FAILURE' on the screen.
    If you could elaborate how you wish to use this, and if we find it to be a useful feature, we could expose this as a proper Sahi API.
  • The way I have done automation in the past, I always tracked the results in each major function and print it to stdout in the end of the function, which helps the analysis of the results much easier in case of failure. Otherwise, when you run a huge batch of tests, you end up spending a lot of time analyzing the results which defeats the purpose. So it would really be something great to have. Let me know if this makes sense.

    Thanks
  • Narayan,

    Which are the global variables we can get to see the result of executed step. We are planning to keep track of every test run we we get new build and store the results into database. So like you get global variable "sahi_has_errors" which tell you whether the script has any errors. Similary i would like to know which are the global variable I can use to track the step status/result.

    thanks,
    Sumeet
Sign In or Register to comment.