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 XML Test Report and other things that can make it better

WebTesterWebTester Members
edited November -1 in Sahi - Open Source
HI,
I have been using SAHI open source for quite some time now.
I have found it very helpfull .But, it lacks some basic things that could make this tool rock
1.Option to specify xml,html for the playback html reports that are generated.This will help in integrating with other reporting systems in organization.- if this can be done in open source ver.
2. Annotation for methods similar to nunit and other automation tools.
e.g
[Test]
function MyTestCase()
{}.Then ,maybe sahi can get identify them as test cases and set the test pass/fail accordingly and other methods can be treated as comm. functions.

Comments

  • globalwormingglobalworming Moderators
    Hi WebTester

    everything you are mentioning is already implemented, though not easy to achieve. To enable XML reports for the Sahi Controller, you have to get the Sahi source code, change the standard reporter in the RhinoScriptRunner.class and build Sahi. Whith some Java knowledge, you could add some kind of select/combobox in the playback tab of the Sahi Controller to choose the report format.

    Well, there are no annotations, but at least we have some kind of jUnit3 behavior, with _runUnitTest()
    see http://sahi.co.in/w/miscellaneous-apis

    Regards
    Wormi
  • Thank you ..
    Can you please provide an example of _runUnitTests() api .The link you provided discribes the feature .I have searched the forum about its usage but did not found much details on usage of the this api .If you can post a sample sah code with multiple methods like you have it for other API's documented.
    specifically ,I am looking for following questions
    1.How to use this API to create the test methods in sah files.
    2.Order of execution for the methods.

    Regarding Junit reporter ,
    Can I use Junit reporter code you have and use sahi's extender feature to include my own jar files with whould be called in my test cases to create the xml file of my test runs ?
    I appriciate if you can guide us on this approach and its feasibility ?
  • globalwormingglobalworming Moderators
    Example (just written here, not tested with Sahi..expect some errors)
    
    function testSomeFeature(){
     // all test steps go here
    }
    
    function testAnotherFeature(){
    // ....
    }
    
    _runUnitTests();
    

    This is pretty much everything, unitTest order may vary.

    Regarding your other request... I really don't know about some Sahi extender. Just check out the Sahi sourcecode and look for net.sf.sahi.Reporting.JUnitReporter and take what you need. Its not my code btw :)
  • I have a question regarding XML.
    we have a xml file which will be always provided by developer team.i wan to modify the the nodes value .
    Which will be the method to be available for writing in the xml.Please provide the example of code.
    for your refrence find below the xml format
    <action id="19" successPathId="20" failurePathId="20">
    <registeredName>PFROperation</registeredName>
    <name>Copy Redo</name>
    <description>Copy Redo log file from Production to DR Database.</description>
    <timeToExecute>0</timeToExecute>
    <recurrence>0</recurrence>
    <syncName />
    <actionFailureEvent />
    <userInputEvent severity="INFO" />
    <userInputOnFailureEvent severity="CRITICAL" />
    - <privateProperties>
    - <ws:pfrOperationAction operation="transfer_fs" configuration="dynamic">
    - <fileset>
    <name />
    <sourceHost>Current Production Component</sourceHost>
    <targetHost>Current DR Component</targetHost>
    <replicationInterval>30</replicationInterval>
    <replicationState>ENABLED</replicationState>
    <targetDirectory>/u01/app/oracle/oradata/ora10g9/</targetDirectory>
    <targetDirectory>/u01/app/oracle/oradata/ora10g9/</targetDirectory>
    <targetDirectory>/u01/app/oracle/oradata/ora10g9/</targetDirectory>
    <sourceDirectory>/u01/app/oracle/oradata/ora10g9/redo01.log</sourceDirectory>
    <sourceDirectory>/u01/app/oracle/oradata/ora10g9/redo02.log</sourceDirectory>
    <sourceDirectory>/u01/app/oracle/oradata/ora10g9/redo03.log</sourceDirectory>
    <initialSynchronization />
    <symbolicLinkFlag>copy_link_only</symbolicLinkFlag>
    <filters />
    </fileset>
    </ws:pfrOperationAction>
    </privateProperties>
    <version>4.0 FCS_P2</version>
    </action>
    Here i want to change the path in targetDirectory node(<targetDirectory>/u01/app/oracle/oradata/ora10g9/</targetDirectory>).
Sign In or Register to comment.