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.

_suiteInfo().suiteName undefined

ov3rov3r Members
edited March 2013 in Sahi Pro
Hi guys,

I have the following problem. I implemented the Sahi Pro software an everything is working fine.
Now I would like to add a script to my test cases to log additional information to a separated database table.
But if I call the method _suiteInfo().suiteName in a test case it is always undefined.

I am starting the Suite with the following command:
java -cp " sahi_home "\lib\ant-sahi.jar net.sf.sahi.test.TestRunner -test " suite " -browserType iexplorer -baseURL " url " -host localhost -port 9999 -threads 1

The usual database logs everything great. What am I doing wrong?

Thanks in advance.

Kind regards
Jorg


Answers

  • Hi Jorg,

    Please try giving
    1. Suite - File Path instead of "suite"
    2. Url - "http://sometest.com"; instead of "url"

    Good Luck !!!
  • ov3rov3r Members
    Hi umashankarqa,

    sorry suite, url and sahi_home are my variables.. :)
    at the Runtime of the script it looks like:
    java -cp C:\sahi_pro\lib\ant-sahi.jar net.sf.sahi.test.TestRunner -test C:\sahi_pro\userdata\scripts\testcases\tracking.suite -browserType iexplore -baseURL http://X.X.X.X/tracking/xhtml/views/mobile/pages/start.xhtml -host localhost -port 9999 -threads 1

    i also tried to alert me the _suiteInfo().suiteName in the testcase. but without any success. It alerts undefined.

    I also get the same result if I run my script with the testrunner.bat
    c:\sahi_pro\userdata\bin>testrunner.bat sahi_tracking_default.suite http://X.X.X.X/tracking/xhtml/views/mobile/pages/start.xhtml iexplore

    I am using the current version of Sahi Pro. With the Java Runtime 1.7.0_11-b21.

    Thanks and kind regards
    Jorg
  • umashankarqaumashankarqa Members
    edited March 2013
    Hi Jorg,

    Can you please try with the below command

    java -cp ..\..\lib\ant-sahi.jar net.sf.sahi.test.TestRunner -test "C:/sahi_pro/userdata/scripts/testcases/tracking.suite" -browserType firefox -baseURL "http://sahi.example.com/_s_/dyn/Driver_initialized"; -host localhost -port 9999 -threads 1

    Thanks,
    Umashankar
  • ov3rov3r Members
    Hi Umashankar,

    Thanks for your reply.

    i browsed to the C:\sahi_pro\userdata\scripts Folder and executed the TestRunner command without success.
    The result of the alert was again undefined.

    I did insert the following two lines.
    _alert(_scriptName());
    _alert(_suiteInfo().suiteName);

    The first alert returned tacking.sah.
    The second alert returned again undefined.

    Kind regards,
    Jorg
  • ov3rov3r Members
    my next test case.. ;)

    I just installed a new Windows-7 virtual machine.
    Then I Installed Java, Sahi Pro 4.5.2, Sahi Pro 4.0 and the current open source version of Sahi in different directory’s.

    Both Sahi pro versions returning the Scriptname correct but the suitename is undefined.
    The Sahi open source version returns both values correct.

    test.suite:
    test.sah http://192.168.0.1/

    test.sah:
    _alert(_scriptName());
    _alert(_suiteInfo().suiteName);

    Testrunner command:
    C:\sahi\userdata\bin>testrunner.bat test.suite http://192.168.0.1 ie

    i wish a nice evening.

    Kind regards,
    Jorg
  • Hi Jorg,

    Yeah! you are correct, Sahi Pro returns suitename value as "undefined".
    Let us take help from Sahi Team.

    Thanks,
    Umashankar



  • ov3rov3r Members
    Thanks to Umashankar and the Support Team of Sahi:

    Solution:
    $suiteInfo = _suiteInfo();
    var $path =$suiteInfo["test"];
    $suiteArray = $path.split("\\");
    $index= $suiteArray.length - 1 ;
    $suitename=$suiteArray[$index];

    Kind regards,
    Jorg
Sign In or Register to comment.