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.

Error loading script.

ghillie14ghillie14 Members
edited November -1 in Sahi - Open Source
When I run sah file, the test passes. When I call it from _include, it brings up this error. I'm sure its not a syntax error, possibly something in the concat file? When I use FF, I get the message below.

Starting script
Error loading script. Firefox may point to the exact line. ReferenceError: click is not defined
https://dev.example.com/_s_/dyn/Player_script/script.js:78
https://dev.example.com/_s_/dyn/Player_script/script.js:84
_navigateTo("https://dev.example.com/amc/login.php";);
_setValue(_textbox("admin_name"), "evans@example.com");
_setValue(_password("admin_pass"), "password.");
_click(_imageSubmitButton(" Log into AMC "));
_click(_link("Customers[1]"));

_sahi.saveCondition(_getText(_cell(_table(7), 1, 4))=="evans_test@example.com"); ReferenceError: click is not defined
https://dev.example.com/_s_/dyn/Player_script/script.js:78
https://dev.example.com/_s_/spr/concat.js:2657
https://dev.example.com/_s_/spr/concat.js:2652
https://dev.example.com/_s_/dyn/Player_script/script.js:2
https://dev.example.com/_s_/dyn/Player_script/script.js:2
https://dev.example.com/_s_/spr/concat.js:2210
https://dev.example.com/_s_/spr/concat.js:2124
Stopping script

The line that it it failing on is shown below.

if (_condition(_getText(_cell(_table(7), 1, 4))=="evans_test@example.com")){
code
}

Any help is appreciated.

Comments

  • narayannarayan Administrators
    Could you also see if there are lines before or after that "if" line which may have a "click" in it?
  • This is the beginning of the original script that is called, which then calls the script that is resulting in the error.

    original script:
    _navigateTo("https://example/login.php";);
    _include("Evans_AMC_Auth.sah");

    Evans_AMC_Auth.sah:
    _setValue(_textbox("admin_name"), "example");
    _setValue(_password("admin_pass"), "example");
    _click(_imageSubmitButton(" Log in"));
    _click(_link("Customers[1]"));

    if (_condition(_getText(_cell(_table(7), 1, 4))=="evans_test@example.com")){
    _click(_cell(_table(7), 1, 4));
    _click(_image(" Edit "));
    _click(_radio("x_customers_auth[1]")); // Auth
    _click(_imageSubmitButton(" Update "));
    }

    The script, evans_AMC_Auth works from the sahi controller but when included in another script, it doesn't work. Hope this helps.
  • This is full script. There are 3 places with the click, and all three seem to work fine.

    _setValue(_textbox("admin_name"), "evans@example.com");
    _setValue(_password("admin_pass"), "example");
    _click(_imageSubmitButton(" Log in ")); (Note: this is the correct line, should have a space after the n in 'in'. Still has the error)
    _click(_link("Customers[1]"));

    if (_condition(_getText(_cell(_table(7), 1, 4))=="evans_test@example.com")){
    _click(_cell(_table(7), 1, 4));
    _click(_image(" Edit "));
    _click(_radio("x_customers_auth[1]")); // Auth
    _click(_imageSubmitButton(" Update "));
    }

    _click(_link("Logoff"));
Sign In or Register to comment.