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.

when i used try catch(e) getting e is undefined

nagarjunnagarjun Members
edited November -1 in Sahi - Open Source
Hi

try{
_popup("VTONG")._setValue(_textbox("DlgLoginForm:txtLogin"), "palven1103");
_popup("VTONG")._setValue(_password("DlgLoginForm:txtPassword"), "palven1103");
_popup("VTONG")._click(_submit("Login"));
_wait(2000);
_popup("VTONG")._assertExists(_label("Destination"));
_popup("VTONG")._assert(_isVisible(_label("Destination")));
_popup("VTONG")._assertEqual("Destination", _getText(_label("Destinatio")));
_popup("VTONG")._assertContainsText("Destination", _label("Destination"));
}catch(e){

_logException(e); // Logs the exception, but does not fail
}
_wait(1000);
_popup("VTONG")._click(_link("Logout"));

when i try above script i am getting this error

"e is undefined (http://10.50.0.133:8080/_s_/spr/concat.js:2085)"

thanks in advance
nagarjun.p

Comments

  • narayannarayan Administrators
    What is in the logs?

    Also change the catch variable from e to say exc and check what the error is.

    Regards,
    Narayan
  • when catch variable is "e" the log file is

    Test Total Steps Failures Errors Success Rate
    Assert_New.sah 7 1 0 85%

    Starting script
    _popup("VTONG")._setValue(_textbox("DlgLoginForm:txtLogin"), "palven1103"); at Jun 23, 2010 11:15:00 AM
    _popup("VTONG")._setValue(_password("DlgLoginForm:txtPassword"), "palven1103"); at Jun 23, 2010 11:15:01 AM
    _popup("VTONG")._click(_submit("Login")); at Jun 23, 2010 11:15:01 AM
    _wait(2000); at Jun 23, 2010 11:15:03 AM
    _popup("VTONG")._assertExists(_label("Destinatio"));
    Assertion Failed. at Jun 23, 2010 11:15:15 AM
    _wait(1000); at Jun 23, 2010 11:15:16 AM
    _popup("VTONG")._click(_link("Logout")); at Jun 23, 2010 11:15:17 AM
    Stopping script

    i changed catch variable from e to exc . but i am getting same error that is

    e is undefined (http://10.50.0.133:8080/_s_/spr/concat.js:2085)

    thanks.
    nagarjuna.p
  • narayannarayan Administrators
    Could you tell us which version of Sahi are you using?
  • hi


    i am using sahi2010-03-10


    Thanks
    nagarjun.p
  • narayannarayan Administrators
    Could you use the latest version and check if it is fixed for you?
  • hi

    i have used "Sahi2010-06-11". eventhough

    i was getting same that "undefined: e is undefined (http://10.50.0.133:8080/_s_/spr/concat.js:2169)"


    the logfile is



    [11:45:13 AM] ravikumar bv: Test Total Steps Failures Errors Success Rate Time Taken (ms)
    rav3_avilability.sah 9 0 0 100% 14875

    Starting script
    _setValue(_textbox("DlgLoginForm:txtLogin"), "bhrrav1431"); at Jun 25, 2010 11:44:29 AM
    _setValue(_password("DlgLoginForm:txtPassword"), "bhrrav1431"); at Jun 25, 2010 11:44:29 AM
    _click(_submit("Login")); at Jun 25, 2010 11:44:29 AM
    _popup("VTONG")._setValue(_textbox("DlgAirSearchEntriesForm:tblOriginDestination:0:txtArrivalLocationCode"), "DXB"); at Jun 25, 2010 11:44:32 AM
    _popup("VTONG")._click(_span(", Dubai")); at Jun 25, 2010 11:44:34 AM
    _popup("VTONG")._click(_image("calender.gif")); at Jun 25, 2010 11:44:34 AM
    _popup("VTONG")._click(_cell("31")); at Jun 25, 2010 11:44:34 AM
    _popup("VTONG")._click(_submit("Availability")); at Jun 25, 2010 11:44:35 AM
    _click(_link("Logout")); at Jun 25, 2010 11:44:41 AM
    undefined: e is undefined (http://10.50.0.133:8080/_s_/spr/concat.js:2169)
    No trace available
    Click for browser script at Jun 25, 2010 11:44:42 AM
    Stopping script

    please respond as soon as possible.

    Thanks
    nagarjuna.P
  • narayannarayan Administrators
    Is the test passing right now? What color is the error message in logs?
  • yes. test was passed. color of the error message was "Orange" with message

    "undefined: e is undefined (http://10.50.0.133:8080/_s_/spr/concat.js:2169)
    No trace available"

    thanks for reply
    Nagarjun.P
Sign In or Register to comment.